mrhhsg opened a new pull request, #65242:
URL: https://github.com/apache/doris/pull/65242
### What problem does this PR solve?
Issue Number: None
Problem Summary:
COUNT_ON_INDEX can still read predicate columns even after segment zone maps
have proven all predicates on those columns are always true and removed them
before SegmentIterator initialization. This makes count queries with range
predicates over high-cardinality columns scan unnecessary column data.
This PR records columns whose predicates are fully removed by segment zone
map pruning, then lets SegmentIterator reuse the existing no-need-read path for
non-output columns or COUNT_ON_INDEX columns. It keeps the existing
output-column protection and adds a common-expression guard so expression
materialization does not skip required data.
### Release note
None
### Check List (For Author)
- Test:
- Unit Test: `./run-be-ut.sh --run
--filter=SegmentIteratorNoNeedReadDataTest.*`
- Regression test: generated and verified
`fault_injection_p0/test_zonemap_always_true_count_on_index` on a local
single-node cluster
- Format: `build-support/clang-format.sh`;
`build-support/check-format.sh`
- Static check: attempted `build-support/run-clang-tidy.sh --build-dir
be/ut_build_ASAN`, but clang-tidy could not analyze this checkout because the
current toolchain reported `stddef.h` file not found and a pre-existing
`clang-tidy-nolint` issue in `be/src/core/types.h`
- Behavior changed: Yes. COUNT_ON_INDEX scans can skip data reads for
predicate columns proven always true by segment zone maps.
- Does this need documentation: No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]