Commit 5c5bee47 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-20109: Optimizer ignores distinct key created for materialized...

Adjust the testcase according to the review input
parent 1165f7cc
......@@ -3273,7 +3273,7 @@ insert into t4 select floor(rand()*1000) from t2 limit 500;
# | 1 | PRIMARY | t3 | ALL | NULL | ... | 10000 | Using where; Using join buffer (flat, BNL join) |
#
# Instead, it should use eq_ref on the materialized table.
explain select * from t3 where a in (select a from t4 group by a);
explain select * from t3 where a in (select a from t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 10000
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
......
......@@ -2959,7 +2959,7 @@ insert into t4 select floor(rand()*1000) from t2 limit 500;
--echo #
--echo # Instead, it should use eq_ref on the materialized table.
explain select * from t3 where a in (select a from t4 group by a);
explain select * from t3 where a in (select a from t4);
drop table t1, t2, t3, t4;
......
......@@ -3286,7 +3286,7 @@ insert into t4 select floor(rand()*1000) from t2 limit 500;
# | 1 | PRIMARY | t3 | ALL | NULL | ... | 10000 | Using where; Using join buffer (flat, BNL join) |
#
# Instead, it should use eq_ref on the materialized table.
explain select * from t3 where a in (select a from t4 group by a);
explain select * from t3 where a in (select a from t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 10000
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment