Details
-
Quality Risk
-
Resolution: Unresolved
-
Major
-
None
-
None
Description
When an order limit is pushed:
select ... from a left outer join b ... order by a.x limit 10
we effectively create
select ... from (select ... from a order by a.x limit 10 ) as a left outer join b ... order by a.x limit 10
such that the order and limit is reapplied. In many cases the order by is the same as rows contained in the join predicate, or we can use a hash/index of the inner side such that the order of the outer remains stable. It's a smaller issue, but it's possible that the higher level limit is also not necessary - if there can only be 0-1 inner rows per outer.