diff options
author | Igor Babaev <igor@askmonty.org> | 2013-04-05 11:24:28 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-04-05 11:24:28 -0700 |
commit | daaa5834c9fb567924c21d467983c1ec3401f832 (patch) | |
tree | 4c5f62da0d45779c5c7bd453f9d1ced35306e988 /mysql-test/r/selectivity_innodb.result | |
parent | 4079a5dc3f98a2c7c53567106b362fc04538c7b6 (diff) | |
download | mariadb-git-daaa5834c9fb567924c21d467983c1ec3401f832.tar.gz |
Fixed bug mdev-4370.
Don't try to a histogram if it is not read into the cache for statistical data.
It may happen so if optimizer_use_condition_selectivity is set to 3. This
setting orders the optimizer not use histograms to calculate selectivity.
Diffstat (limited to 'mysql-test/r/selectivity_innodb.result')
-rw-r--r-- | mysql-test/r/selectivity_innodb.result | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index cc9b5475ac1..256b93d8cb5 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -801,6 +801,34 @@ SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 DROP TABLE t1,t2; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +# +# Bug mdev-4370: Histograms have bean created, but the query is run after +# FLUSH TABLES with optimizer_use_condition_selectivity=3 +# +set use_stat_tables=PREFERABLY; +set histogram_size=10; +set histogram_type='SINGLE_PREC_HB'; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (9), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +FLUSH TABLES; +set optimizer_use_condition_selectivity=3; +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE a > 3; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 75.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > 3) +SELECT * FROM t1 WHERE a > 3; +a +9 +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +DROP TABLE t1; +set histogram_size=@save_histogram_size; +set histogram_type=@save_histogram_type; +set use_stat_tables=@save_use_stat_tables; set use_stat_tables=@save_use_stat_tables; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; SET SESSION STORAGE_ENGINE=DEFAULT; |