jacktengg opened a new pull request, #69776:
URL: https://github.com/apache/doris/pull/69776
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
TopN scans can retain unnecessary equal-boundary rows and
continue reading pages after runtime bounds tighten. Static scan-key
normalization can also remove shared runtime predicates, which prevents
readers from consuming later bounds.
This change improves the complete filtering path:
- Use strict LT/GT bounds for eligible single-key TopN directly above one
OLAP scan, after retaining LIMIT + OFFSET candidates. Keep inclusive
bounds for other plans and old descriptors.
- Use versioned predicate snapshots to refresh unread ranges through page
Zone Maps. Preserve existing restrictions, consumed positions and scan
direction. Apply the first bound promptly and throttle later refreshes.
- Identify SharedPredicate as a runtime filter and preserve runtime
predicates during static scan-key normalization. Continue removing
static predicates fully covered by scan keys.
In a 1,048,576-row ascending three-key TopN check, enabling runtime
filtering on the patched build reduced raw reads from 1,048,576 to 16,384
rows and page accesses from 372 to 6. Results remained identical. These
are filtering-off/on comparisons, not query latency measurements.
### Release note
Eligible TopN queries can discard additional equal-boundary rows and skip
unread page ranges as runtime bounds arrive or tighten. Runtime predicates
remain available on leading storage keys after scan-key normalization.
### 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]