Repository navigation
perf: place broadcast runtime filters before costly predicates - #2909
Draft
wirybeaver wants to merge 1 commit into
Draft
wirybeaver wants to merge 1 commit into
wirybeaver wants to merge 1 commit into
Conversation
2 of 5 tasks
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.
Which issue does this PR close?
Implements Task 5 of #2700.
Rationale for this change
In the TPC-DS SF100 results for #2749, runtime filtering increased median latency for Q37 and Q82. In Q82, the broadcast probe hashed every inventory row before a cheap quantity range and a join against 70 build rows.
What changes are included in this PR?
For a same-stage broadcast probe, AQE places
RuntimeFilterApplyExecimmediately below the lowest costlyFilterExecon the eligible scan path. Cheaper filters below that point run first. A broadcast probe with only cheap predicates skips the apply. The planner uses six non-leaf expression nodes as a heuristic for predicate cost.An undecided staged build can still produce a summary for partitioned fallback, where filtering the probe saves shuffle work.
Are there any user-facing changes?
With
ballista.planner.runtime_filter.enabled = true, the placement of runtime filters in broadcast probe plans can change.Test
The distributed join test compares results with filtering enabled and disabled, including NULL-safe equality. Its execution plan confirms that a filter was bound and pruned rows. A local TPC-H Q19 SF10 check also matched results and reported 59.60 million rows pruned. The SF100 latency impact on Q37 and Q82 is still open.