-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Optimize](Map) Optimize MapFileColumnIterator::read_by_rowids for batched map access #58485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 34379 ms |
TPC-DS: Total hot run time: 184924 ms |
…tched map access - Replace the per-row seek + next_batch(1) loop in MapFileColumnIterator::read_by_rowids with batched offset reads via OffsetFileColumnIterator::read_by_rowids to derive key/value ranges for the requested rowids. - Compute per-row map sizes from offset[rowid] and offset[rowid+1], using the page-tail next_array_item_ordinal sentinel for the last row when rowid+1 is out of bounds. - Skip key/value decoding for null rows by consulting a pre-fetched null map, and add a safety check to reject non-nullable destination columns when the underlying map reader is nullable. - Reuse a small peek column in OffsetFileColumnIterator::_peek_one_offset to avoid repeated temporary column allocations when reading page sentinels. - Add a unit test (MapReadByRowidsSkipReadingResizesDestination) to verify that read_by_rowids honors the SKIP_READING flag and only resizes the destination column without touching sub-iterators.
3b9e323 to
a9b5d9d
Compare
|
run buildall |
ClickBench: Total hot run time: 27.14 s |
TPC-H: Total hot run time: 34259 ms |
TPC-DS: Total hot run time: 182291 ms |
ClickBench: Total hot run time: 27.27 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
csun5285
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
PR approved by anyone and no changes requested. |
airborne12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
…tched map access (apache#58485) - Replace the per-row seek + next_batch(1) loop in MapFileColumnIterator::read_by_rowids with batched offset reads via OffsetFileColumnIterator::read_by_rowids to derive key/value ranges for the requested rowids. - Compute per-row map sizes from offset[rowid] and offset[rowid+1], using the page-tail next_array_item_ordinal sentinel for the last row when rowid+1 is out of bounds. - Skip key/value decoding for null rows by consulting a pre-fetched null map, and add a safety check to reject non-nullable destination columns when the underlying map reader is nullable. - Reuse a small peek column in OffsetFileColumnIterator::_peek_one_offset to avoid repeated temporary column allocations when reading page sentinels. - Add a unit test (MapReadByRowidsSkipReadingResizesDestination) to verify that read_by_rowids honors the SKIP_READING flag and only resizes the destination column without touching sub-iterators. - Improve performance from ~19s to ~0.1s in the worst-case access pattern, and from ~6s to ~3s in the normal case.
…tched map access (#58485) - Replace the per-row seek + next_batch(1) loop in MapFileColumnIterator::read_by_rowids with batched offset reads via OffsetFileColumnIterator::read_by_rowids to derive key/value ranges for the requested rowids. - Compute per-row map sizes from offset[rowid] and offset[rowid+1], using the page-tail next_array_item_ordinal sentinel for the last row when rowid+1 is out of bounds. - Skip key/value decoding for null rows by consulting a pre-fetched null map, and add a safety check to reject non-nullable destination columns when the underlying map reader is nullable. - Reuse a small peek column in OffsetFileColumnIterator::_peek_one_offset to avoid repeated temporary column allocations when reading page sentinels. - Add a unit test (MapReadByRowidsSkipReadingResizesDestination) to verify that read_by_rowids honors the SKIP_READING flag and only resizes the destination column without touching sub-iterators. - Improve performance from ~19s to ~0.1s in the worst-case access pattern, and from ~6s to ~3s in the normal case.
…rning (#59286) ### What problem does this PR solve? Problem Summary: ### Release note Cherry-pick #58370 #58354 #59043 #58851 #58485 #58682 #58614 #58373 #57204 #58719 #58471 #58573 #58657 ### 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: apache/doris-website#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 --> --------- Co-authored-by: 924060929 <lanhuajian@selectdb.com> Co-authored-by: Jerry Hu <mrhhsg@gmail.com> Co-authored-by: Jerry Hu <hushenggang@selectdb.com> Co-authored-by: lihangyu <lihangyu@selectdb.com>
from ~6s to ~3s in the normal case.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)