There are two tables T1 and T2. I want to delete those in T1 if they are already in T2.
This is the first statement:
delete T1.* from T1 inner join T2 on T1.col1 = T2.col1;
The execution takes 2 seconds.
However, if I rewrite the statement in a different way as below:
delete from T1 where col1 in (select col1 from T2);
Guess, how much time does it take to execute? 8 minutes!