Prune hash join probe side via dynamic discrete values from the build side - #25292
Prune hash join probe side via dynamic discrete values from the build side#25292gruuya wants to merge 1 commit into
Conversation
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
7b174d8 to
f116035
Compare
f116035 to
542e11a
Compare
542e11a to
4b9a166
Compare
Exposes HashTableLookupExpr's single-column build values through the same compact sorted-domain rewrite ordinary large IN-lists already get (PrimitiveInListPruningExpr/StringInListPruningExpr), so row-group/file min/max stats alone can exclude containers - no bloom filter fetch, no LiteralGuarantee. On by default via hash_join_dynamic_pruning_max_distinct_values (default 100_000); set to 0 to disable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4b9a166 to
e09baaa
Compare
|
run benchmark tpch |
|
Hi @gruuya, thanks for the request (#25292 (comment)). Only whitelisted users can trigger benchmarks. Allowed users: 2010YOUY01, Dandandan, Fokko, Jefffrey, Omega359, Rachelint, Rich-T-kid, adriangb, alamb, asubiotto, avantgardnerio, brunal, buraksenn, cetra3, codephage2020, coderfender, comphead, erenavsarogullari, etseidl, friendlymatthew, gabotechs, geoffreyclaude, grtlr, haohuaijin, jayzhan211, jonathanc-n, kevinjqliu, klion26, kosiew, kumarUjjawal, kunalsinghdadhwal, liamzwbao, mbutrovich, mkleen, mzabaluev, neilconway, rluvaton, sdf-jkl, timsaucer, xudong963, zhuqi-lucas. File an issue against this benchmark runner |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #25292 +/- ##
========================================
Coverage 81.91% 81.91%
========================================
Files 1134 1134
Lines 425637 425866 +229
Branches 425637 425866 +229
========================================
+ Hits 348654 348853 +199
- Misses 56302 56323 +21
- Partials 20681 20690 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Which issue does this PR close?
Rationale for this change
Avoid scanning redundant files/row-groups/pages in the probe side of hash joins, based on the values dictated by the build side.
What changes are included in this PR?
PushdownStrategy::Map/HashTableLookupExprto carry the build side values from a hash joinbuild_predicate_expressionto build the associated pruning expression fromHashTableLookupExprWhat is the testing strategy for this PR?
Unit tests added covering all changes.
Also tested manually that the problem from the issue is resolved now
Note that the scanned rows are shrunk 10x (
output_rows=1.99 Mvsoutput_rows=200.0 K), and consequently the execution time is improved 5x (0.096vs0.019seconds). It would be good to benchmark this more broadly.Are there any user-facing changes?
Yes, the two new configs mirroring the in-list ones, as well as the construction API for
HashTableLookupExpr, which now accepts an optional values arg too.