| 267 | } |
| 268 | |
| 269 | static 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 | |
| 294 | void ChunkedNodeGroup::scan(const Transaction* transaction, const TableScanState& scanState, |
| 295 | const NodeGroupScanState& nodeGroupScanState, offset_t rowIdxInGroup, |
no test coverage detected