Skip to content
Permalink
Browse files

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

Adjust the testcase according to the review input
  • Loading branch information...
spetrunia committed Aug 29, 2019
1 parent ef76f81 commit a379f151b18e4bc7e4c26be5f5e1254a59e27bfa
@@ -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

0 comments on commit a379f15

Please sign in to comment.
You can’t perform that action at this time.