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

Method scan

src/storage/table/chunked_node_group.cpp:294–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void ChunkedNodeGroup::scan(const Transaction* transaction, const TableScanState& scanState,
295 const NodeGroupScanState& nodeGroupScanState, offset_t rowIdxInGroup,
296 length_t numRowsToScan) const {
297 DASSERT(rowIdxInGroup + numRowsToScan <= numRows);
298 auto& anchorSelVector = scanState.outState->getSelVectorUnsafe();
299 if (getZoneMapResult(scanState, chunks) == ZoneMapCheckResult::SKIP_SCAN) {
300 anchorSelVector.setToFiltered(0);
301 return;
302 }
303
304 if (versionInfo) {
305 versionInfo->getSelVectorToScan(transaction->getStartTS(), transaction->getID(),
306 anchorSelVector, rowIdxInGroup, numRowsToScan);
307 } else {
308 anchorSelVector.setToUnfiltered(numRowsToScan);
309 }
310
311 if (anchorSelVector.getSelSize() > 0) {
312 for (auto i = 0u; i < scanState.columnIDs.size(); i++) {
313 const auto columnID = scanState.columnIDs[i];
314 if (columnID == INVALID_COLUMN_ID) {
315 scanState.outputVectors[i]->setAllNull();
316 continue;
317 }
318 if (columnID == ROW_IDX_COLUMN_ID) {
319 for (auto rowIdx = 0u; rowIdx < numRowsToScan; rowIdx++) {
320 scanState.rowIdxVector->setValue<row_idx_t>(rowIdx,
321 rowIdx + rowIdxInGroup + startRowIdx);
322 }
323 continue;
324 }
325 DASSERT(columnID < chunks.size());
326 chunks[columnID]->scan(transaction, nodeGroupScanState.chunkStates[i],
327 *scanState.outputVectors[i], rowIdxInGroup, numRowsToScan);
328 }
329 }
330}
331
332template<ResidencyState SCAN_RESIDENCY_STATE>
333void ChunkedNodeGroup::scanCommitted(const Transaction* transaction, TableScanState& scanState,

Callers

nothing calls this directly

Calls 6

getZoneMapResultFunction · 0.85
setToFilteredMethod · 0.80
getSelVectorToScanMethod · 0.80
setToUnfilteredMethod · 0.80
getSelSizeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected