|
|
|
@@ -1464,7 +1464,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
|
|
|
|
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1`
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1`
|
|
|
|
|
explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
|
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
|
|
|
@@ -1476,13 +1476,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
|
|
|
|
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1`
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1`
|
|
|
|
|
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
|
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
|
|
|
|
|
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index; Using where
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1`
|
|
|
|
|
Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < _latin1'a2')))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1`
|
|
|
|
|
drop table t1,t2;
|
|
|
|
|
create table t2 (a int, b int);
|
|
|
|
|
create table t3 (a int);
|
|
|
|
@@ -1737,14 +1737,14 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where
|
|
|
|
|
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where not(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where (`test`.`t1`.`id` < 8)))))
|
|
|
|
|
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where (`test`.`t1`.`id` < 8))))))
|
|
|
|
|
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
|
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
|
1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where
|
|
|
|
|
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 Using where; Using index
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1
|
|
|
|
|
Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where not(exists(select `test`.`t1`.`id` AS `id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null)))
|
|
|
|
|
Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(exists(select `test`.`t1`.`id` AS `id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))
|
|
|
|
|
insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
|
|
|
|
|
create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
|
|
|
|
|
insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
|
|
|
|
|