diff options
author | Igor Babaev <igor@askmonty.org> | 2011-09-30 18:55:02 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-09-30 18:55:02 -0700 |
commit | 715dc5f99ddf852a5ef45bcb68c6c86298f6a7c3 (patch) | |
tree | 3557e3bfdfa8723372daf13fa6f46ffdd30483b6 /mysql-test/r/subselect_sj2.result | |
parent | 42b928ca05fca3ae8858566622a3a483a70aa3fc (diff) | |
download | mariadb-git-715dc5f99ddf852a5ef45bcb68c6c86298f6a7c3.tar.gz |
Fixed a cost estimation bug introduced into in the function best_access_path
of the 5.3 code line after a merge with 5.2 on 2010-10-28
in order not to allow the cost to access a joined table to be equal
to 0 ever.
Expanded data sets for many test cases to get the same execution plans
as before.
Diffstat (limited to 'mysql-test/r/subselect_sj2.result')
-rw-r--r-- | mysql-test/r/subselect_sj2.result | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index e4e66ce01f2..155bffe4d73 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -16,6 +16,7 @@ b int, key(b) ); insert into t2 select a, a/2 from t0; +insert into t2 select a+10, a+10/2 from t0; select * from t1; a b 1 1 @@ -33,6 +34,16 @@ a b 7 4 8 4 9 5 +10 5 +11 6 +12 7 +13 8 +14 9 +15 10 +16 11 +17 12 +18 13 +19 14 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary @@ -51,6 +62,7 @@ pk1 char(200), pk2 char(200), pk3 char(200), primary key(pk1, pk2, pk3) ) engine=innodb; insert into t3 select a,a, a,a,a from t0; +insert into t3 select a,a, a+100,a+100,a+100 from t0; explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary @@ -58,6 +70,8 @@ id select_type table type possible_keys key key_len ref rows Extra select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 +1 1 101 101 101 +2 2 102 102 102 2 2 2 2 2 set @save_max_heap_table_size= @@max_heap_table_size; set max_heap_table_size=16384; @@ -420,6 +434,7 @@ create table t0 (a int); insert into t0 values (0),(1),(2),(3),(4); create table t1 (a int, b int, key(a)); insert into t1 select a,a from t0; +insert into t1 select a+5,a from t0; create table t2 (a int, b int, primary key(a)); insert into t2 select * from t1; Table t2, unlike table t1, should be displayed as pulled out @@ -428,11 +443,11 @@ where t0.a in ( select t1.a from t1,t2 where t2.a=t0.a and t1.b=t2.b); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t0 ALL NULL NULL NULL NULL 5 100.00 Using where -1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Start temporary -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t0.a 1 100.00 Using where; End temporary +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t0.a 1 100.00 +1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t2`.`a` = `test`.`t0`.`a`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`)) update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; select * from t0 where t0.a in |