explain select * from v1 where v1.c1 in
|
(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
|
id select_type table type possible_keys key key_len ref rows Extra
|
-1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
|
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
|
2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
|
explain delete from v1 where v1.c1 in
|
(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
|
id select_type table type possible_keys key key_len ref rows Extra
|
-1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
|
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
|
2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
|
delete from v1 where v1.c1 in
|
(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
|