-
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
Bad SQL generation for common query pattern #2637
Comments
Is that not EF6 ? |
That is EF6, yes. I forgot to mention. I request the change for EF7. |
Hey, This issue relates to EF6, which is managed in a separate repo (currently on CodePlex, but we are considering moving it to GitHub). We have taken a note on #2341 to consider this scenario and the SQL you suggested when we work on GroupBy translation in EF7. Regarding this scenario in EF6, give that we are going to improve this in EF7 and the relative complexity/risk of adjusting the query pipeline in EF6 we aren't planning to address this in EF6. We would consider accepting a pull request though if someone outside our team wanted to contribute the change. ~Rowan |
See http://stackoverflow.com/questions/31458265/entity-framework-sum-case-not-optimized. The pattern presented there is a common query pattern to achieve a pivot. Since EF has no other way to generate a pivot this pattern should probably be made to work well.
I'm reproducing the key parts of the question here:
I'm hoping that this is a minor change to the EF query generation pipeline. I do not propose specifically recognizing this pattern and doing something with it. Rather, I see no reason this SQL should not translate to something reasonable. Maybe there are some easy to address issues in code generation.
The text was updated successfully, but these errors were encountered: