dotnet / dotnet/efcore

Trim projection inside unused joins

Open
#28,426 0 comments 1 reaction 0 assignees View on GitHub
area-query
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.