You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider these input queries, which are equivalent, and differ only in the lexical order of predicates:
select*from A, B
where (A.ID=B.ID(+) ANDB.ID=1);
select*from A, B
where (B.ID=1ANDA.ID=B.ID(+));
Transforming the Oracle style to ANSI JOIN yields different results:
select*from A
join B
onA.ID=B.IDwhereB.ID=1;
select*from A
left outer join B
onA.ID=B.IDwhereB.ID=1;
Both are correct. The one that produces an inner join applies an optimisation that seems not to be applied otherwise. Perhaps, the optimisation isn't worth it, given that:
it seems to be tricky to apply independently of predicate ordering
it doesn't matter in cases like these, as the RDBMS will perform the optimisation anyway
without the optimisation, the user "intent" is reflected more clearly
there may be an edge case where the optimisation produces wrong SQL?
The text was updated successfully, but these errors were encountered:
As reported here:
https://blog.jooq.org/2020/11/17/automatically-transform-oracle-style-implicit-joins-to-ansi-join-using-jooq/#comment-404345
Consider these input queries, which are equivalent, and differ only in the lexical order of predicates:
Transforming the Oracle style to ANSI JOIN yields different results:
Both are correct. The one that produces an
inner join
applies an optimisation that seems not to be applied otherwise. Perhaps, the optimisation isn't worth it, given that:The text was updated successfully, but these errors were encountered: