-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improvement](spill) optimize the spilling logic of hash join operator #32202
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. |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 38412 ms |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 38238 ms |
| struct PartitionedHashJoinSharedState : public HashJoinSharedState { | ||
| std::vector<std::unique_ptr<vectorized::MutableBlock>> partitioned_build_blocks; | ||
| std::vector<vectorized::SpillStreamSPtr> spilled_streams; | ||
| bool need_to_spill {false}; |
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.
= false we should unify the init operator
| auto& block = partitioned_blocks[i]; | ||
| if (block) { | ||
| if (block && block->rows() >= state->batch_size()) { | ||
| mem_size += block->allocated_bytes(); |
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.
This method is not right for bitmap column, we should consider replace this logic.
| bool PartitionedHashJoinProbeOperatorX::_should_revoke_memory(RuntimeState* state) const { | ||
| auto& local_state = get_local_state(state); | ||
|
|
||
| if (local_state._shared_state->need_to_spill) { |
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.
build: 1 2 3 4
partition 1 --> memory
probe --> block ---> partition 4 ---> probe partition 1, left probe partition 2,3,4
memtable spill stream 的buffer
build --> sort
|
run buidall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
|
TeamCity be ut coverage result: |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...