Support translating complex type equality when one/both of them is a subquery
Open
area-query
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
We translate complex type equality by comparing each one of the properties from each side (`a == b` => `a.Prop1 == b.Prop1 && a.Prop2 == b.Prop2`). However, if one of the sides is a subquery, we fail since we don't want to duplicate the subquery for each property being compared (that would be very bad perf).
Once we support CTEs, we can simply wrap the subquery with a CTE, and then reference that multiple times. Note the similarity with #15972, which is essentially the same thing for the ID property comparison of entities with composite keys.
Contributor guide
Assessment
This issue has not been assessed yet.