Misc minor optimizations to query optimizer performance#21128
Draft
AdamGS wants to merge 3 commits intoapache:mainfrom
Draft
Misc minor optimizations to query optimizer performance#21128AdamGS wants to merge 3 commits intoapache:mainfrom
AdamGS wants to merge 3 commits intoapache:mainfrom
Conversation
d71431d to
eec93a2
Compare
AdamGS
commented
Mar 23, 2026
| true | ||
| } | ||
|
|
||
| #[expect(clippy::only_used_in_recursion)] |
Contributor
Author
There was a problem hiding this comment.
this is just wasteful, just a lint away.
AdamGS
commented
Mar 23, 2026
| let left_schema = join.left.schema(); | ||
| let right_schema = join.right.schema(); | ||
|
|
||
| let left_schema_columns = schema_columns(left_schema.as_ref()); |
Contributor
Author
There was a problem hiding this comment.
I think there might be an even better thing here, but I need to do another pass
AdamGS
commented
Mar 23, 2026
|
|
||
| fn analyze(&self, plan: LogicalPlan, config: &ConfigOptions) -> Result<LogicalPlan> { | ||
| let empty_schema = DFSchema::empty(); | ||
| static EMPTY_SCHEMA: LazyLock<DFSchema> = LazyLock::new(DFSchema::empty); |
Contributor
Author
There was a problem hiding this comment.
empty DFSchema isn't free, similar to #20534
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
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?
Rationale for this change
Inspired by @blaginin, trying to find more places that might drag the optimizer's performance. On my laptop , this improves many of the sql planner's benchmarks by a fairly consistent 2-5% on my laptop.
What changes are included in this PR?
Are these changes tested?
Existing tests.
Are there any user-facing changes?
None