子查询展开(subquery unnesting)
Query OK, 0 rows affected (0.70 sec)
OceanBase (root@test)> create table t2(a int primary key, b int, c int);
Query OK, 0 rows affected (0.92 sec)
--- 有依赖关系的子查询被展开改写成连接
OceanBase (root@test)> explain select * from t1 where t1.a in (select t2.b from t2 where t2.c = t1.c);
---------------------------------------
|0 |HASH SEMI JOIN| |1 |2924|
|1 | TABLE SCAN |t1 |1000 |455 |
|2 | TABLE SCAN |t2 |1000 |455 |
=======================================
-------------------------------------
0 - output([t1.a], [t1.b], [t1.c]), filter(nil),
equal_conds([t1.a = t2.b], [t2.c = t1.c]), other_conds(nil)
1 - output([t1.c], [t1.a], [t1.b]), filter(nil),
access([t1.c], [t1.a], [t1.b]), partitions(p0)
2 - output([t2.c], [t2.b]), filter(nil),