-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DDC-2076 Remove useless join over target table of ManyToMany relationship #8438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Maybe SqlWalker
need some integration tests, but I'm not sure if this should be done in the scope of this PR.
@SenseException The I think the patch is good, thanks. unrelated however I realized this must provide wrong results on composite keys or not? It seems weird to iterate the columns and add multiple in conditions, maybe I am wrong. |
@plfort i am a bit hesitant to merge a cosmetic PR into a branch in bugfix mode, the old code works, so this is an improvement and changing the SQL is a bit more risky, so I would like you to rebase this on 2.9 and we can merge it there. |
…oMany relationship
47663a9
to
c75ce1e
Compare
I agree with you about composite keys, it requires further tests. I thought about it but for this change I wanted to keep the behaviour. |
Rebase on 2.9 done BTW |
if this PR did fix #2758, that issue can get closed now |
Quite an old issue : #2758
I noticed this additional "join" while trying to optimize a query. As mentioned in the issue, I don't see a case when this join is useful.
In my case (query optimization), this PR provides a significant reduction of the query cost given by Postgresql