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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user