docs: Document that adding new optimizer rules are expensive#20348
Open
alamb wants to merge 2 commits intoapache:mainfrom
Open
docs: Document that adding new optimizer rules are expensive#20348alamb wants to merge 2 commits intoapache:mainfrom
alamb wants to merge 2 commits intoapache:mainfrom
Conversation
neilconway
approved these changes
Feb 15, 2026
adriangb
approved these changes
Feb 16, 2026
Contributor
adriangb
left a comment
There was a problem hiding this comment.
Left a small suggestion
Comment on lines
+242
to
+244
| // - Adding a new rule here is expensive as it will be applied to all | ||
| // queries, and will likely increase the optimization time. Please extend | ||
| // existing rules when possible, rather than adding a new rule. |
Contributor
There was a problem hiding this comment.
Suggested change
| // - Adding a new rule here is expensive as it will be applied to all | |
| // queries, and will likely increase the optimization time. Please extend | |
| // existing rules when possible, rather than adding a new rule. | |
| // - Adding a new rule here is expensive as it will be applied to all | |
| // queries, and will likely increase the optimization time. Please extend | |
| // existing rules when possible, rather than adding a new rule. | |
| // If you do add a new rule considering having aggressive no-op paths | |
| // (e.g. if the plan doesn't contain any of the nodes you are looking for | |
| // return `Transformed::no`; only works if you control the traversal). |
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
As part of PR reviews, it seems like it is not obvious to some contributors that there is a non trivial cost to adding new optimizer rules. Let's add that knowledge into the codebase as comments, so it may be less of a surprise
What changes are included in this PR?
Add comments
Are these changes tested?
N/A
Are there any user-facing changes?
No this is entirely internal comments oly