diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-15 18:08:08 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-15 18:08:08 +0100 |
commit | 25609313ffbd9205e921d0793cf423f711d10ced (patch) | |
tree | f04a1c26fabcc5463aca51a860f03131e02d94f7 /mysql-test/r/myisam_mrr.result | |
parent | 47a54a2e087a7c1fc861bcbc114c14987f492cfe (diff) | |
parent | 764eeeee74f999fe2107fc362236563be0025093 (diff) | |
download | mariadb-git-25609313ffbd9205e921d0793cf423f711d10ced.tar.gz |
5.3.4 merge
Diffstat (limited to 'mysql-test/r/myisam_mrr.result')
-rw-r--r-- | mysql-test/r/myisam_mrr.result | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mysql-test/r/myisam_mrr.result b/mysql-test/r/myisam_mrr.result index 9dd3602bab7..01d3e6aeb5d 100644 --- a/mysql-test/r/myisam_mrr.result +++ b/mysql-test/r/myisam_mrr.result @@ -557,4 +557,66 @@ COUNT(alias2.f2) set @@join_cache_level= @tmp_730133_jcl; set @@optimizer_switch= @tmp_730133_os; drop table t1; +# +# Test of MRR handler counters +# +flush status; +show status like 'Handler_mrr%'; +Variable_name Value +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int, filler char(200), key(a)); +insert into t1 +select A.a+10*B.a+100*C.a+1000*D.a, 123,'filler' from t0 A, t0 B, t0 C, t0 D; +explain select sum(b) from t1 where a < 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 8 Using index condition; Rowid-ordered scan +# This should show one MRR scan and no re-fills: +flush status; +select sum(b) from t1 where a < 10; +sum(b) +1230 +show status like 'handler_mrr%'; +Variable_name Value +set @mrr_buffer_size_save= @@mrr_buffer_size; +set mrr_buffer_size=128; +explain select sum(b) from t1 where a < 1600; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 1380 Using index condition; Rowid-ordered scan +# This should show one MRR scan and one extra rowid sort: +flush status; +select sum(b) from t1 where a < 1600; +sum(b) +196800 +show status like 'handler_mrr%'; +Variable_name Value +set @@mrr_buffer_size= @mrr_buffer_size_save; +#Now, let's check BKA: +set @join_cache_level_save= @@join_cache_level; +set @join_buffer_size_save= @@join_buffer_size; +set join_cache_level=6; +explain select sum(t1.b) from t0,t1 where t0.a=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 ref a a 5 test.t0.a 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +flush status; +select sum(t1.b) from t0,t1 where t0.a=t1.a; +sum(t1.b) +1230 +show status like 'handler_mrr%'; +Variable_name Value +set join_buffer_size=10; +explain select sum(t1.b) from t0,t1 where t0.a=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 ref a a 5 test.t0.a 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +flush status; +select sum(t1.b) from t0,t1 where t0.a=t1.a; +sum(t1.b) +1230 +show status like 'handler_mrr%'; +Variable_name Value +set join_cache_level= @join_cache_level_save; +set join_buffer_size= @join_buffer_size_save; +drop table t0, t1; set optimizer_switch= @myisam_mrr_tmp; |