Prefetch join hash table bucket - #1390
Open
IsaacWarren wants to merge 2 commits into
Open
Conversation
IsaacWarren
marked this pull request as ready for review
September 8, 2026 17:22
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1390 +/- ##
==========================================
+ Coverage 66.55% 68.16% +1.61%
==========================================
Files 198 198
Lines 68731 68961 +230
Branches 9834 9905 +71
==========================================
+ Hits 45744 47009 +1265
+ Misses 20071 19077 -994
+ Partials 2916 2875 -41 |
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.
Summary
prefetch_bucketmethod to the vendored ankerl hash map that issues a read-only__builtin_prefetchfor the bucket cache linefind()will touchi, the bucket line for rowi + D(D=16, tunable viaBODO_JOIN_PROBE_PREFETCH_DIST) is prefetched, hiding part of the dependent cache-miss chain that dominatesht_probe_timeproduce_probe_outputout of the loop (resolved once per batch, passed as raw pointers)The join probe hot loop is a pointer chase: hash -> bucket line -> entry/key line. Hardware prefetchers cannot help (non-stride).
ht_probe_timewas ~30% of the probe stage, the largest join-side timer.Performance findings
All benchmarks: 8 workers, TPC-H SF10, interleaved A/B rounds, stage metrics from
BODO_TRACING_OUTPUT_DIR(wall-clock medians; medians of 3 runs for the microbench).Pure join microbenchmark (lineitem 60M x orders 15M int keys)
ht_probe_time/ rank-execProbe stage total -13%.
Full TPC-H SF10, all 22 queries
ht_probe_time