Skip to content
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

Translate nested CASE to simpler COALESCE #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bgurmendi
Copy link
Contributor

@bgurmendi bgurmendi commented Apr 30, 2018

When EntityFramework UseDatabaseNullSemantics == true or when using null propagation expressións (?? or ?) EntityFramework6 generates and expression tree with many nested CASE WHEN expressions.

When this happens the generated SQL query is hard to analyze for optimizations.

Also CASE expression breaks Postgres type inference in many cases. View: #60 #62 #84 #87 #90 issues for more detail.

This pull request is a starting point for solving described issues. And very annoying #60 #62 #84 #87 #90 issues.

@bgurmendi
Copy link
Contributor Author

There are many compilation errores, sorry. I will fix all of then and open new pull request

@bgurmendi bgurmendi closed this Apr 30, 2018
@bgurmendi bgurmendi reopened this Apr 30, 2018
@bgurmendi
Copy link
Contributor Author

Solved compilation errors and added unit tests

@rwasef1830
Copy link
Contributor

Hello,
Thanks for your contribution, I will look at this as soon as I can!
Can you please squash all commits to make it easier to review ? Thanks!

@bgurmendi bgurmendi force-pushed the translate_multiple_nested_case_to_simpler_coalesce_fix_issues_62_60 branch from 8029321 to cfbfa07 Compare May 2, 2018 09:09
@bgurmendi
Copy link
Contributor Author

bgurmendi commented May 2, 2018

I have squash all commits into one.
In any case, the #93 pull request is simpler and more urgent than this, and the core concept is the same, translate "case" to coalesce.

Differences:

Both solves issues #60 #62 #84 #87 #90

I think is better to prioritize the other pull request #93 and later work on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants