数据仓库服务 GAUSSDB(DWS)-案例:NOT IN转NOT EXISTS:优化后

时间:2024-11-28 17:37:19

优化后

可将查询可以修改为:

1
SELECT * FROM t1 WHERE NOT EXISTS (SELECT * FROM t2 WHERE t2.c = t1.c);

执行下列语句,查询NOT EXISTS的执行计划:

1
EXPLAIN VERBOSE SELECT * FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE t2.c = t1.c);

support.huaweicloud.com/devg-dws/dws_04_1000.html