efcore
efcore copied to clipboard
Query: IN expression optimization of constant should move to compilation phase
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)).
Same goes for FromSql where parameters are constant expression.