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

Trim projection inside unused joins #28426

Open
smitpatel opened this issue Jul 12, 2022 · 0 comments
Open

Trim projection inside unused joins #28426

smitpatel opened this issue Jul 12, 2022 · 0 comments

Comments

@smitpatel
Copy link
Contributor

When we prune SelectExpression we find columns which are being referenced from outside to trim down projection in inner subqueries.
For Left/Inner join (which are also generated by TPT/entity splitting), we need to verify if the join is not used outside. In order to do that, we specifically process it differently and avoid adding terms from join predicate. Essentially, if the join says nothing is referenced from outside, it can be eliminated altogether which is what we do for tables marked for TPT/entity splitting. Though due to this, tables added by user will have no outer referenced columns hence we don't trim them. We can trim them to have only join predicate terms so that join continue working but doesn't give additional data.

This doesn't apply for any join which actually end up participating in outer level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants