WHERE EXISTS vs IN in Amazon Redshift

2019-08-12 01:13发布

问题:

I run EXPLAIN on two versions of the same query in Amazon Redshift:

SELECT t1.column
FROM table1 t1
WHERE t1.column IN
(SELECT t2.column FROM table2 t2);

SELECT t1.column
FROM table1 t1
WHERE EXISTS
(SELECT 1 FROM table2 t2 WHERE t1.column = t2.column );

They seem to have the same query plan. Does that mean that there is no performance difference between IN and WHERE EXISTS as Redshift somehow optimizes the SQL input before compiling the query?