Skip to content

perf(push_down_filter): skip filter revalidation#21667

Open
kumarUjjawal wants to merge 1 commit intoapache:mainfrom
kumarUjjawal:fix/slow_push_down_filter
Open

perf(push_down_filter): skip filter revalidation#21667
kumarUjjawal wants to merge 1 commit intoapache:mainfrom
kumarUjjawal:fix/slow_push_down_filter

Conversation

@kumarUjjawal
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

PushDownFilter rebuilds many Filter nodes on very large plans. Each rebuild used Filter::try_new, which re-ran predicate typevalidation. On the sql_planner_extended benchmark, that repeated workwas a big part of planning time.

This change adds an unchecked filter constructor for internal optimizer use and uses it inside PushDownFilter when the predicate is already a known-valid filter expression.

What changes are included in this PR?

  • add Filter::new_unchecked for internal optimizer use
  • keep alias stripping the same as Filter::try_new
  • switch PushDownFilter to use the unchecked path when rebuilding
    filters
  • add focused tests for alias stripping and checked vs unchecked
    behavior

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added logical-expr Logical plan and expressions optimizer Optimizer rules labels Apr 16, 2026
@joroKr21 joroKr21 mentioned this pull request Apr 16, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant