mariadb/mysql-test/suite/compat/oracle
Sergei Petrunia 5bcc115d77 MDEV-36055 Allow left join reordering
(Based on a patch by Yuchen Pei)
When computing table dependencies in simplify_joins(), do not make
LEFT JOIN-ed table (or join nest) to be dependent on all preceding tables.

For queries in form

  t1
  LEFT JOIN t2 ON t2.col=t1.col
  LEFT JOIN t3 ON t3.col=t1.col

this allows the optimizer to construct join order of t1-t3-t2. Before
this patch, t1-t2-t3 was the only possible order.

Note that queries that use Oracle's Outer Join syntax (col1(+)=col2) are
converted into chained independent LEFT JOINs like the above.

The optimization is controlled by optimizer_switch='reorder_outer_joins=ON'

It is NOT enabled by default as it is known to expose problems with
join pruning. It is advised to set optimizer_prune_level=0 when setting
reorder_outer_joins=on.

Co-authored-by: Yuchen Pei <ycp@mariadb.com>
2026-01-28 14:11:44 +02:00
..
r MDEV-36055 Allow left join reordering 2026-01-28 14:11:44 +02:00
t MDEV-36055 Allow left join reordering 2026-01-28 14:11:44 +02:00