[improvement](be): reduce duplicate key memtable memory - #67507
Open
zghong wants to merge 1 commit into
Open
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Author
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #67505
Problem Summary:
What does this PR optimize?
For
DUP_KEYSmemtables, each input row was previously represented by ashared_ptr<RowInBlock>. However, duplicate-key tables do not require the per-row aggregation state stored inRowInBlock; they only need the source row position for sorting.This PR introduces a compact representation for
DUP_KEYS:uint32_tvector instead of allocating ashared_ptr<RowInBlock>for every row._row_in_blocksonly forUNIQUE_KEYSandAGG_KEYS, which still need per-row aggregation state.RowInBlockobjects.Benchmark
The benchmark measures the row-index construction path directly affected by this change. It was run with a Release build and five repetitions:
./be/output/lib/benchmark_test \ --benchmark_filter='BM_DuplicateKeyRowIndex.*' \ --benchmark_repetitions=5 \ --benchmark_report_aggregates_only=trueCPU mean results:
shared_ptr<RowInBlock>uint32_t indexEstimated row-metadata footprint:
shared_ptr<RowInBlock>representationThis reduces the estimated row-metadata footprint by:
The previous estimate does not include the allocation/control-block overhead of make_shared, so the actual memory reduction may be larger.
Note that this is a focused microbenchmark for row-index construction and does not represent the end-to-end performance improvement of a complete load job.
Release note
Reduce duplicate-key load memory use and row-index construction overhead.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)