-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to #9395 - Query: Apply CompositePredicateExpressionVisitor to jo…
…in predicates Some optimizations that are applied to predicates in SelectExpression can be safely applied to join predicates as well. Fix modifies CompositePredicateExpressionVisitor to also look into JoinExpression predicates and not only SelectExpression predicates. Also changes the way we build join predicates themselves, when inheritance is concerned - now the discriminator predicate will be extracted out of the conditional expression, so that the comparisons are sargable. Before: ((a is Derived) ? a.DerivedFK : null) == b.PK - which translated to CASE block (not sargable) After: a is Derived && a.DerivedFK == b.PK
- Loading branch information
Showing
4 changed files
with
68 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.