MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / appendStorageInfoForIndex

Function appendStorageInfoForIndex

src/function/table/storage_info.cpp:226–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static void appendStorageInfoForIndex(StorageInfoLocalState* localState, DataChunk& outputChunk,
227 const Index& index) {
228 const auto indexInfo = index.getIndexInfo();
229 for (const auto& entry : index.getStorageEntries()) {
230 if (entry.pageRange.startPageIdx == INVALID_PAGE_IDX || entry.pageRange.numPages == 0) {
231 continue;
232 }
233 resetOutputIfNecessary(localState, outputChunk);
234 auto vectorPos = outputChunk.state->getSelVector().getSelSize();
235 outputChunk.getValueVectorMutable(0).setValue(vectorPos, std::string{"INDEX"});
236 outputChunk.getValueVectorMutable(1).setValue<uint64_t>(vectorPos, INVALID_NODE_GROUP_IDX);
237 outputChunk.getValueVectorMutable(2).setValue<uint64_t>(vectorPos, INVALID_NODE_GROUP_IDX);
238 outputChunk.getValueVectorMutable(3).setValue(vectorPos, std::string{"ON_DISK"});
239 outputChunk.getValueVectorMutable(4).setValue(vectorPos, indexInfo.name);
240 outputChunk.getValueVectorMutable(5).setValue(vectorPos,
241 indexInfo.indexType + ":" + entry.component);
242 outputChunk.getValueVectorMutable(6).setValue<uint64_t>(vectorPos,
243 entry.pageRange.startPageIdx);
244 outputChunk.getValueVectorMutable(7).setValue<uint64_t>(vectorPos,
245 entry.pageRange.numPages);
246 outputChunk.getValueVectorMutable(8).setValue<uint64_t>(vectorPos, entry.sizeBytes);
247 outputChunk.getValueVectorMutable(9).setValue(vectorPos, std::string{});
248 outputChunk.getValueVectorMutable(10).setValue(vectorPos, std::string{});
249 outputChunk.getValueVectorMutable(11).setValue(vectorPos, std::string{});
250 outputChunk.state->getSelVectorUnsafe().incrementSelSize();
251 }
252}
253
254static offset_t tableFunc(const TableFuncInput& input, TableFuncOutput& output) {
255 auto& dataChunk = output.dataChunk;

Callers 1

tableFuncFunction · 0.85

Calls 5

resetOutputIfNecessaryFunction · 0.85
getSelSizeMethod · 0.80
incrementSelSizeMethod · 0.80
getStorageEntriesMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected