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

Function getZoneMapResult

src/storage/table/chunked_node_group.cpp:269–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269static ZoneMapCheckResult getZoneMapResult(const TableScanState& scanState,
270 const std::vector<std::unique_ptr<ColumnChunk>>& chunks) {
271 if (!scanState.columnPredicateSets.empty()) {
272 for (auto i = 0u; i < scanState.columnIDs.size(); i++) {
273 const auto columnID = scanState.columnIDs[i];
274 if (columnID == INVALID_COLUMN_ID || columnID == ROW_IDX_COLUMN_ID) {
275 continue;
276 }
277
278 DASSERT(i < scanState.columnPredicateSets.size());
279 if (chunks[columnID]->hasUpdates()) {
280 // With updates, we need to merge with update data for the correct stats, which can
281 // be slow if there are lots of updates. We defer this for now.
282 return ZoneMapCheckResult::ALWAYS_SCAN;
283 }
284 const auto columnZoneMapResult = scanState.columnPredicateSets[i].checkZoneMap(
285 chunks[columnID]->getMergedColumnChunkStats());
286 if (columnZoneMapResult == ZoneMapCheckResult::SKIP_SCAN) {
287 return ZoneMapCheckResult::SKIP_SCAN;
288 }
289 }
290 }
291 return ZoneMapCheckResult::ALWAYS_SCAN;
292}
293
294void ChunkedNodeGroup::scan(const Transaction* transaction, const TableScanState& scanState,
295 const NodeGroupScanState& nodeGroupScanState, offset_t rowIdxInGroup,

Callers 1

scanMethod · 0.85

Calls 5

emptyMethod · 0.45
sizeMethod · 0.45
hasUpdatesMethod · 0.45
checkZoneMapMethod · 0.45

Tested by

no test coverage detected