jacktengg opened a new pull request, #70020:
URL: https://github.com/apache/doris/pull/70020
### What problem does this PR solve?
Issue Number: None
Related PR: #69776
Problem Summary:
Segment readers keep row ranges computed before a TopN runtime bound arrives
or tightens. Scan-key normalization can also remove a shared runtime predicate
on a leading storage key. Readers then miss later bound updates.
Publish versioned predicate snapshots and use page Zone Maps to refresh
unread row ranges between batches. Apply the first bound immediately and
throttle later refreshes by the number of raw rows read. Preserve scan
progress, bitmap holes, and read direction. Refresh the bitmap cursor, cached
cardinality, and filter counters together. Keep shared runtime predicates
during static scan-key normalization while still removing static predicates
covered by scan keys.
In the existing ascending TopN check with 1,048,576 rows and three sort
keys, ScanRows fell from 1,048,576 to 16,384 and TotalPagesNum fell from 372 to
6. These figures compare filtering disabled and enabled on the same patched
build. The query results were identical.
### Release note
TopN scans can skip unread pages when runtime bounds arrive or tighten.
Runtime predicates remain active after scan-key normalization.
### Check List (For Author)
- Test: Manual checks of commit boundaries, dependencies, generated-result
preservation, whitespace, clang-format v16, and header hygiene. Include BE unit
tests and two TopN regression suites. Builds and tests were not rerun for this
commit split.
- Behavior changed: Yes. TopN scans can read fewer rows and pages. This
commit retains inclusive runtime bounds.
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
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]