-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query :: nested Conditional expressions could be optimized #2881
Comments
FWIW, SQL Server has a limit of 10 levels of nesting for CASE expressions and this did become an issue with previous versions of EF because we used to generate nested case statements often, so we had to do case flattening as a bug fix rather than as optimization. Not saying that we are anywhere near this with EF Core. |
Closing as duplicate of #12729 |
@smitpatel, it's not really a duplicate. It was fixed in .Net Core 2.2 but appeared again in .Net Core 3.0! You must re-close it (close it again). |
Currently nested Conditional expressions are not optimized, we translate them to:
CASE WHEN c1 THEN r1 ELSE (CASE WHEN c2 THEN r2 ELSE r3 END) END
We could instead simplify it to:
CASE WHEN c1 THEN r1 WHEN r2 THEN r2 ELSE r3 END
The text was updated successfully, but these errors were encountered: