Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify projections #1936

Closed
wants to merge 13 commits into from

Conversation

max-hoffman
Copy link
Contributor

@max-hoffman max-hoffman commented Aug 11, 2023

View into an add-on feature to name resolution. Not intended for merging.

This is an example of a simplification rule that optimizes a node before it is added to a plan. In this case, we are deduplicating projection nodes at a point when we have the most tagging metadata about expression ids. We do not remove projections when a subquery expression backreferences an alias in the same scope. This will revert many of the extra projections in the earlier PRs.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// of optimizations local to this specific node. Eventually there should be a
// top level optimizer with a switch for every type.

func factoryBuildProject(p *plan.Project) (sql.Node, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want me to just make it factory.BuildProject to start with? splitting it off into a package seemed premature

@Hydrocharged Hydrocharged deleted the max/simplify-projections branch August 24, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants