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.
Description
We spent some time figuring out where time was being spent in the gen4 planner, and it turned out that our analyzer was being inefficient while examining the AST.
During semantic analysis, we do a number of things, and these things impact each other. We do:
*
expressions to the columns in the tables. yeah, it doesn't really make sense that we are rewriting the AST while doing analysis, but the alternative is worse. because this step introduces columns into the AST, they would need to be bound separately, unless we could do this before binding has happenedBefore, we did this in three passes of the AST:
This PR changes this, and does all of analysing and rewriting in a single step.
Performance-wise, the new analyzer makes the Gen4 planner about 16% faster compared to the old analyzer. Below is the output of
benchstat
comparing Gen4's micro-benchmarks using the old and new analyzer.Related Issue(s)
#7280
Checklist