efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Query: IN expression optimization of constant should move to compilation phase

Open roji opened this issue 6 years ago • 1 comments
trafficstars

Our InExpressionValuesExpandingExpressionVisitor rewrites the values of InExpression, for parameter and constant values. Constant values rewriting can be moved to the compilation phase - there's no reason to do this again for each query.

This would speed up queries such as .Where(x => new[] { 1, 2, 3 }.Contains(x)).

roji avatar Jul 01 '19 15:07 roji

Same goes for FromSql where parameters are constant expression.

smitpatel avatar Sep 24 '19 23:09 smitpatel