Repository navigation
perf: infer join predicates from filtered inputs - #27055
Open
alexanderbianchi wants to merge 1 commit into
Open
alexanderbianchi wants to merge 1 commit into
alexanderbianchi wants to merge 1 commit into
Conversation
alexanderbianchi
marked this pull request as ready for review
November 3, 2026 16:58
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?
No linked issue; reproducer below.
Rationale for this change
A key filter inside a join input is not propagated to the other side of an equi-join:
Previously, only
areceived the static filter. This change also derivesb.k = 'k1', allowing it to be pushed toward the other scan. It also handles predicates pushed below joins by an external planner.What changes are included in this PR?
Extend
PushDownFilterinference to use deterministic predicates from inner-join inputs, through column projections and aliases. Preserve the original predicates and avoid adding ones already guaranteed by the destination. Scan predicates are used only when the provider reports exact pushdown.What is the testing strategy for this PR?
SQL regressions cover both directions, CTEs/aliases, multiple keys, ranges, NULL-safe equality, LIMIT, repeated passes, and conservative handling of computed keys, volatile predicates and outer joins. A provider-level test covers exact versus inexact scan filters and optimizer idempotence. Existing Parquet plan expectations now verify that the inferred static filter reaches the other scan alongside its dynamic filter.
Local validation: the required extended workspace suite passes (13,451 Rust tests and 547 SQL test files), along with formatting and all-targets/all-features Clippy with warnings denied. The existing filter-pushdown planner benchmark detected no significant change against the base commit (local
ciprofile).Are there any user-facing changes?
Filtered inner joins can now apply additional static filters before reading the other input. No public API changes.