Implement PullUp Empty Results optimizer#13524
Merged
Mytherin merged 13 commits intoduckdb:featurefrom Oct 11, 2024
Merged
Conversation
Contributor
Author
|
Main needs to be merged into feature, then the commit history should be cleaned up a little bit |
…s refer to the CTE, and if it is removed, then there are heap use after free errors
8821d57 to
8f5f4cb
Compare
Member
|
Can you fix the conflict please? |
…ith_empty_result_if_child_is_empty
lnkuiper
requested changes
Oct 2, 2024
Collaborator
lnkuiper
left a comment
There was a problem hiding this comment.
Thanks for the PR! This looks good, I just have some minor comments:
|
|
||
| namespace duckdb { | ||
|
|
||
| //! The Deliminator optimizer traverses the logical operator tree and removes any redundant DelimGets/DelimJoins |
Collaborator
There was a problem hiding this comment.
Could you update this comment to describe this operator?
| } | ||
|
|
||
| unique_ptr<LogicalOperator> Optimize(unique_ptr<LogicalOperator> op); | ||
| unique_ptr<LogicalOperator> PullUpEmptyJoinChildren(unique_ptr<LogicalOperator> op); |
Collaborator
There was a problem hiding this comment.
Could you make PullUpEmptyJoinChildren private?
lnkuiper
approved these changes
Oct 3, 2024
Collaborator
lnkuiper
left a comment
There was a problem hiding this comment.
Thanks for the changes, LGTM!
Collaborator
|
Thanks! Looks great |
2 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.
Currently this logic is sprinkled within filter pull up and filter push down. The problem is it's not at every operator, and adding empty results across multiple files within the filter pullup/pushdown operator can make the code hard to maintain and debug.
This will unify the code and fix some fuzzer issues that are the cause of long execution times on the LHS of a join while a child on the RHS is empty . It can also help make other queries faster in a few cases.
One con is that some
ConversionErrorswill be hidden.