Merged
Conversation
Contributor
nickitat
commented
Feb 18, 2025
src/Planner/PlannerJoinTree.cpp
Outdated
| right_header, | ||
| planner_context->getQueryContext(), | ||
| std::move(hash_table_stat_cache_key), | ||
| /*rhs_estimation=*/{}); |
Member
Author
There was a problem hiding this comment.
this means it will not take any effect if took this branch
ClickHouse/src/Planner/PlannerJoinTree.cpp
Lines 2044 to 2046 in 5daf76d
Member
Author
Member
|
Do you plan to return to this PR? |
Member
Author
Yes, it awaited #76613 |
f0de853 to
0fc678a
Compare
This was referenced Apr 25, 2025
nickitat
added a commit
that referenced
this pull request
Apr 28, 2025
Cherry pick #76185 to 25.3: Parallel hash join threshold
robot-clickhouse
added a commit
that referenced
this pull request
Apr 28, 2025
nickitat
added a commit
that referenced
this pull request
Apr 28, 2025
Cherry pick #76185 to 25.4: Parallel hash join threshold
robot-clickhouse
added a commit
that referenced
this pull request
Apr 28, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 29, 2025
Make #76185 backportable
robot-clickhouse
added a commit
that referenced
this pull request
Apr 29, 2025
robot-clickhouse
added a commit
that referenced
this pull request
Apr 29, 2025
nickitat
added a commit
that referenced
this pull request
Apr 30, 2025
Backport #76185 to 25.4: Parallel hash join threshold
nickitat
added a commit
that referenced
this pull request
Apr 30, 2025
Backport #76185 to 25.3: Parallel hash join threshold
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.
Changelog category (leave one):
Related: #75261
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Introduced threshold (regulated by setting
parallel_hash_join_threshold) to fall back to thehashalgorithm when the size of the right table is below the threshold.The new logic uses the right table size estimation to guess if the
parallel_hashwill be worth it. It is done here:ClickHouse/src/Processors/QueryPlan/Optimizations/optimizeJoin.cpp
Lines 345 to 361 in 524c44b
To make it happen, we now collect another data point in
HashTablesStatistics-source_rows, meaning exactly the amount of rows in the right-hand side (not the amount of distinct join key values):ClickHouse/src/Interpreters/HashTablesStatistics.h
Lines 54 to 62 in 524c44b
It is needed to be able to differentiate between these two cases:
ClickHouse/tests/queries/0_stateless/03356_threshold_for_parallel_hash.sql
Lines 57 to 75 in 524c44b