-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] split chunk of HashTable #51175
Merged
meegoo
merged 17 commits into
StarRocks:main
from
murphyatwork:murphy_opt_split_build_chunk
Oct 18, 2024
Merged
[Enhancement] split chunk of HashTable #51175
meegoo
merged 17 commits into
StarRocks:main
from
murphyatwork:murphy_opt_split_build_chunk
Oct 18, 2024
Conversation
This file contains 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
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
8 times, most recently
from
September 23, 2024 06:44
888d040
to
efd3854
Compare
trueeyu
reviewed
Sep 23, 2024
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
from
September 24, 2024 23:37
efd3854
to
67007f2
Compare
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
from
October 12, 2024 02:38
70ea039
to
96fe3e9
Compare
Signed-off-by: Murphy <[email protected]>
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
from
October 14, 2024 07:06
bc548fd
to
59c88a4
Compare
Signed-off-by: Murphy <[email protected]>
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
from
October 15, 2024 08:13
59c88a4
to
adf5fde
Compare
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
Signed-off-by: Murphy <[email protected]>
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
2 times, most recently
from
October 17, 2024 11:13
1367a69
to
5888092
Compare
Signed-off-by: Murphy <[email protected]>
murphyatwork
force-pushed
the
murphy_opt_split_build_chunk
branch
from
October 18, 2024 00:59
5888092
to
80fd5dc
Compare
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 280 / 296 (94.59%) file detail
|
trueeyu
approved these changes
Oct 18, 2024
wyb
approved these changes
Oct 18, 2024
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
✅ Backports have been created
|
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Oct 18, 2024
Signed-off-by: Murphy <[email protected]> (cherry picked from commit 5dd0cc5) # Conflicts: # be/src/column/binary_column.h # be/src/exec/join_hash_map.cpp # be/src/exec/join_hash_map.h # be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp # be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.h
42 tasks
mergify bot
pushed a commit
that referenced
this pull request
Oct 18, 2024
Signed-off-by: Murphy <[email protected]> (cherry picked from commit 5dd0cc5) # Conflicts: # be/src/column/binary_column.h # be/src/exec/join_hash_map.cpp # be/src/exec/join_hash_map.h # be/src/exec/join_hash_map.tpp # be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp # be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.h # be/src/exec/spill/mem_table.cpp
42 tasks
ZiheLiu
pushed a commit
to ZiheLiu/starrocks
that referenced
this pull request
Oct 31, 2024
Signed-off-by: Murphy <[email protected]>
24 tasks
renzhimin7
pushed a commit
to renzhimin7/starrocks
that referenced
this pull request
Nov 7, 2024
Signed-off-by: Murphy <[email protected]> Signed-off-by: zhiminr.ren <[email protected]>
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.
Why I'm doing:
JoinHashTable::build_chunk
is aChunk
which contains all data from build side, it means it can be very large for particular cases. As a result, it can easily encounter the memory allocation issue, when jemalloc/os cannot allocate a large continuous memory, as above exception.The particular cases can be:
What I'm doing:
Split that chunk into multiple smaller segments(whose rows is usually 131072) to get rid of this issue:
SegmentedChunk
andSegmentedColumn
to replace originalChunk
andColumn
offset%segment_size
, rather than maintaining a index for it. It's effective enough with static segment_size.Potential downside and considerations of this approach:
JoinHashMap
, it needs to randomly copy data from thebuild_chunk
according tobuild_index
. WithSegmentedChunk
, since the memory address is not continuous anymore, we need to lookup the segment first then lookup the record in it. To deal with it, we try best to use theSegmentedChunkVisitor
to reduce this overhead via eliminating the virtual function callkey_column
ofJoinHashMap
cannot not use columns ofbuild_chunk
anymore. Since their memory layout is different,key_column
use a continuous column, butbuild_chunk
uses a segmented way. It would introduce some memory overhead and memory copy overhead.key_column
segmented ? The overhead is relatively larger for the probe procedure, and also it needs to change a lot of code, which is beyond the scope. So we choose the easy pathPerformance
The
bench_segmented_chunk_clone
is still slower than regularchunk_clone
, it mostly comes from the unpredictable random memory access during copy. Considering it can help memory allocation, i think it's worth to do it.We can further optimize the performance through make the memory access more sequential.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: