summaryrefslogtreecommitdiff
path: root/mysql-test/main/range.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-28 12:22:56 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-28 12:22:56 +0300
commit7830fb7f45b3824c0375c00ae2cab357165904cf (patch)
tree730521737fdc48e69f7650819e9a29da6487e1f4 /mysql-test/main/range.result
parentb805ebd7ed49868f83e6fd3fe72a11ddacdce452 (diff)
parent55163ba1bdb1a05daadc66c41c959994231b361c (diff)
downloadmariadb-git-7830fb7f45b3824c0375c00ae2cab357165904cf.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/range.result')
-rw-r--r--mysql-test/main/range.result41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result
index 052ea09d5ac..464c0bf031a 100644
--- a/mysql-test/main/range.result
+++ b/mysql-test/main/range.result
@@ -2981,5 +2981,46 @@ deallocate prepare stmt;
set optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
#
+# MDEV-16934: using system variable eq_range_index_dive_limit
+# to reduce the number of index dives
+#
+create table t1 (a int, b varchar(31), index idx(a));
+insert into t1 values
+(7,'xxxx'), (1,'yy'), (3,'aaa'), (1,'bbb'), (2,'zz'),
+(4,'vvvvv'), (7,'ddd'), (9,'zzzzz'), (1,'cc'), (5,'ffff');
+insert into t1 select a+10, concat(b,'zz') from t1;
+insert into t1 select a+15, concat(b,'yy') from t1;
+insert into t1 select a+100, concat(b,'xx') from t1;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+select cast(count(a)/count(distinct a) as unsigned) as rec_per_key from t1;
+rec_per_key
+2
+set eq_range_index_dive_limit=0;
+explain select * from t1 where a in (8, 15, 31, 1, 9);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx idx 5 NULL 7 Using index condition
+select * from t1 where a in (8, 15, 31, 1, 9);
+a b
+1 yy
+1 bbb
+1 cc
+9 zzzzz
+15 ffffzz
+set eq_range_index_dive_limit=2;
+explain select * from t1 where a in (8, 15, 31, 1, 9);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx idx 5 NULL 10 Using index condition
+select * from t1 where a in (8, 15, 31, 1, 9);
+a b
+1 yy
+1 bbb
+1 cc
+9 zzzzz
+15 ffffzz
+set eq_range_index_dive_limit=default;
+drop table t1;
+#
# End of 10.2 tests
#