You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
3743
+
set @save_use_stat_tables= @@use_stat_tables;
3744
+
set @@optimizer_use_condition_selectivity=4;
3745
+
set @@use_stat_tables=PREFERABLY;
3746
+
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
3747
+
id select_type table type possible_keys key key_len ref rows filtered Extra
3748
+
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
3749
+
1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
3750
+
2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
3751
+
Warnings:
3752
+
Note 1003 select `test`.`t1_outer`.`a` AS `a` from <materialize> (select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where (`test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`)
3753
+
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
3754
+
set @@use_stat_tables=@save_use_stat_tables;
3755
+
explain extended SELECT a FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a);
3756
+
id select_type table type possible_keys key key_len ref rows filtered Extra
3757
+
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 8 100.00
3758
+
1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 2 100.00 Using index
3759
+
2 MATERIALIZED t1 range NULL a 5 NULL 8 100.00 Using index for group-by
3760
+
Warnings:
3761
+
Note 1003 select `test`.`t1_outer`.`a` AS `a` from <materialize> (select max(`test`.`t1`.`b`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` `t1_outer` where (`test`.`t1_outer`.`a` = `<subquery2>`.`max(b)`)
0 commit comments