efcore
efcore copied to clipboard
Minor improvement of `SqlServerParameterBasedSqlProcessor.Optimize`
Running the SkipTakeCollapsingExpressionVisitor before RelationalParameterBasedSqlProcessor.Optimize opens up some additional query optimization opportunities that can lead to a simpler query.
This was found while investigating #33752, but is actually unrelated to that issue. Note that there is no real bug here, except for a complex query where a simpler one would suffice. AFAICT there is not issue tracking this.
I'm always a bit scared when changing order of operations in the optimizer, but this one should be safe. Thanks @ranma42