1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Some simple optimisation

= ANY and <> ALL converted to (NOT) IN to get advantage of IN optimisation
This commit is contained in:
bell@laptop.sanja.is.com.ua
2003-10-08 17:40:54 +03:00
parent 381b680868
commit afac13d033
5 changed files with 69 additions and 18 deletions

View File

@@ -947,8 +947,12 @@ create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
insert into t2 values ('a1'),('a2');
select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
explain select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
explain select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
explain select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
explain select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
drop table t1,t2;