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

Track prunability of inner joins on the expression itself #32674

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

roji
Copy link
Member

@roji roji commented Dec 25, 2023

When a join is added to a select, it's optionally marked as removable, i.e. eligible for pruning if not referenced by any column; this is checked while pruning to prevent removing joins which are important for preserving correct data even when not referenced (e.g. an inner join can be used to filter).

In line with the current architecture, this information is stored on a private list on SelectExpression; this means that all code that accesses it must be on SelectExpression itself (and not on an external visitor, where it can be overridden e.g. by a provider); it also means we must take care to always copy it when duplicating selects, and generally causes unnecessary bookkeeping.

This PR is a pure refactor which moves the information to the tables themselves, where it can be accessed freely from anywhere. This is part of a larger effort to remove private state from SelectExpression and simplify the pipeline.

Part of #31049

Instead of on a private list on SelectExpression.
Part of dotnet#31049
@roji roji force-pushed the PruningRemovableJoins branch from 1f09220 to ff71406 Compare December 29, 2023 15:30
@roji roji merged commit e093b2c into dotnet:main Dec 30, 2023
7 checks passed
@roji roji deleted the PruningRemovableJoins branch December 30, 2023 07:30
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.

2 participants