diff --git a/optd-sqlplannertest/tests/joins/join_enumerate.planner.sql b/optd-sqlplannertest/tests/joins/join_enumerate.planner.sql index 336e45b7..8aa8a622 100644 --- a/optd-sqlplannertest/tests/joins/join_enumerate.planner.sql +++ b/optd-sqlplannertest/tests/joins/join_enumerate.planner.sql @@ -82,27 +82,35 @@ select * from t2, t1, t3 where t1v1 = t2v1 and t1v2 = t3v2; */ -- Test whether the optimizer enumerates all 3-join orders. (It don't currently) -select * from t1, t2, t3 where t1v1 = t2v1 and t1v2 = t3v2; +select * from t1, (select * from t2, t3) where t1v1 = t2v1 and t1v2 = t3v2; /* -(Join t2 (Join t1 t3)) -(Join t2 (Join t3 t1)) -(Join t3 (Join t1 t2)) -(Join t3 (Join t2 t1)) -(Join (Join t1 t2) t3) -(Join (Join t1 t3) t2) -(Join (Join t2 t1) t3) -(Join (Join t3 t1) t2) - -(Join t2 (Join t1 t3)) -(Join t2 (Join t3 t1)) -(Join t3 (Join t1 t2)) -(Join t3 (Join t2 t1)) -(Join (Join t1 t2) t3) -(Join (Join t1 t3) t2) -(Join (Join t2 t1) t3) -(Join (Join t3 t1) t2) - +(Join t1 (Join t2 t3)) +(Join (Join t2 t3) t1) + +(Join t1 (Join t2 t3)) +(Join (Join t2 t3) t1) + +LogicalProjection { exprs: [ #0, #1, #2, #3, #4, #5 ] } +└── LogicalFilter + ├── cond:And + │ ├── Eq + │ │ ├── #0 + │ │ └── #2 + │ └── Eq + │ ├── #1 + │ └── #4 + └── LogicalJoin { join_type: Cross, cond: true } + ├── LogicalScan { table: t1 } + └── LogicalProjection { exprs: [ #0, #1, #2, #3 ] } + └── LogicalJoin { join_type: Cross, cond: true } + ├── LogicalScan { table: t2 } + └── LogicalScan { table: t3 } +PhysicalHashJoin { join_type: Inner, left_keys: [ #0, #1 ], right_keys: [ #0, #2 ] } +├── PhysicalScan { table: t1 } +└── PhysicalNestedLoopJoin { join_type: Cross, cond: true } + ├── PhysicalScan { table: t2 } + └── PhysicalScan { table: t3 } 0 0 0 200 0 300 1 1 1 201 1 301 2 2 2 202 2 302 diff --git a/optd-sqlplannertest/tests/joins/join_enumerate.yml b/optd-sqlplannertest/tests/joins/join_enumerate.yml index ee5caab1..9fe19109 100644 --- a/optd-sqlplannertest/tests/joins/join_enumerate.yml +++ b/optd-sqlplannertest/tests/joins/join_enumerate.yml @@ -29,9 +29,9 @@ - explain:logical_join_orders - execute - sql: | - select * from t1, t2, t3 where t1v1 = t2v1 and t1v2 = t3v2; + select * from t1, (select * from t2, t3) where t1v1 = t2v1 and t1v2 = t3v2; desc: Test whether the optimizer enumerates all 3-join orders. (It don't currently) tasks: - explain[disable_pruning]:logical_join_orders - - explain:logical_join_orders + - explain:logical_join_orders,logical_optd,physical_optd - execute