mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
optimisation of independent ALL/ANY with aggregate function (WL#1115) (SCRUM)
This commit is contained in:
@ -1347,4 +1347,13 @@ explain select * from t3 where a >= all (select b from t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
|
||||
insert into t2 values (2,2), (2,1), (3,3), (3,1);
|
||||
select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
a
|
||||
6
|
||||
7
|
||||
explain select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
|
||||
drop table if exists t2, t3;
|
||||
|
@ -877,6 +877,7 @@ insert into t1 values (1);
|
||||
insert into t2 values (1);
|
||||
select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1);
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# update subquery with wrong field (to force name resolving
|
||||
# in UPDATE name space)
|
||||
@ -897,4 +898,9 @@ create table t3 (a int);
|
||||
insert into t3 values (6),(7),(3);
|
||||
select * from t3 where a >= all (select b from t2);
|
||||
explain select * from t3 where a >= all (select b from t2);
|
||||
|
||||
# optimized static ALL/ANY with grouping
|
||||
insert into t2 values (2,2), (2,1), (3,3), (3,1);
|
||||
select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
explain select * from t3 where a > all (select max(b) from t2 group by a);
|
||||
drop table if exists t2, t3;
|
||||
|
Reference in New Issue
Block a user