You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTa.Id, a.NameFrom Aninals AS a
LEFT JOIN Birds AS b
LEFT JOIN would not affect the result set size. (Whereas INNER JOIN will do filter if no matching rows hence cannot be removed).
This would prune all the derived table joins from TPT if not used. Some overlap with #21773
But this enhancement can be applicable outside of TPT also
e.g.
fromcincustomers
join oinorders on c.CustomerID equals o.CustomerID into groupingfromoingrouping.DefaultIfEmpty()selectc.CustomerID
The text was updated successfully, but these errors were encountered:
Note: This is not possible in all cases. It is possible only when LeftJoin has cardinality of 0..1 Otherwise inner even though null can duplicate outers. An example outside of TPT for this would be Principal to dependent reference navigation which is not marked as required. Ideally we should have a flag and appropriately update LeftJoinExpression in Sql so that we can remove them later if not reference outside. We could also do it in LINQ but that would require traversing whole tree and inspecting which breaks natural cut down flow.
A simple case would be SQL like this
LEFT JOIN would not affect the result set size. (Whereas INNER JOIN will do filter if no matching rows hence cannot be removed).
This would prune all the derived table joins from TPT if not used. Some overlap with #21773
But this enhancement can be applicable outside of TPT also
e.g.
The text was updated successfully, but these errors were encountered: