summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2023-03-17 16:01:19 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-03-17 16:01:19 +0300
commit5d498645ac14481356dad2b50d491947ce99f61c (patch)
treea8ae4d56e950a2c60337866968926e1e1b2effb8
parentd4339620be44091127647eb5ec8f593c0d6fa882 (diff)
downloadmariadb-git-bb-10.4-spetrunia-tmp.tar.gz
-rw-r--r--mysql-test/main/selectivity.result4
-rw-r--r--mysql-test/main/selectivity.test1
-rw-r--r--mysql-test/main/selectivity_innodb.result6
3 files changed, 10 insertions, 1 deletions
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index 0b922609916..76f088299c6 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -1659,6 +1659,10 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2
# Now, the equality is used for ref access, while the range condition
# gives selectivity data
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
explain extended select * from t1 where a in (17,51,5) and b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.80 Using index condition; Using where; Using rowid filter
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index 9c82a8d37a7..e2716d1c4bb 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -1120,6 +1120,7 @@ explain extended select * from t1 use index () where b=2;
--echo # Now, the equality is used for ref access, while the range condition
--echo # gives selectivity data
+analyze table t1 persistent for all;
explain extended select * from t1 where a in (17,51,5) and b=2;
drop table t1;
diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result
index 6c6811f9754..1a512ed49c7 100644
--- a/mysql-test/main/selectivity_innodb.result
+++ b/mysql-test/main/selectivity_innodb.result
@@ -1669,9 +1669,13 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2
# Now, the equality is used for ref access, while the range condition
# gives selectivity data
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
explain extended select * from t1 where a in (17,51,5) and b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref b,a b 5 const 59 2.90 Using where
+1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
drop table t1;