diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-12 13:46:06 +0200 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-12 13:46:06 +0200 |
| commit | 839cf16bb2de078d5000bcb2f9b3151f1ebda708 (patch) | |
| tree | 52deb93bd818156b0168601aefc9afbc537b1dbf /mysql-test/main/partition.test | |
| parent | dce2cc1c6a82d1ed9f4db9c39bc9cb1d3815a019 (diff) | |
| parent | 91173f986373e4f5f134a2351a80d8763e5157e8 (diff) | |
| download | mariadb-git-839cf16bb2de078d5000bcb2f9b3151f1ebda708.tar.gz | |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/partition.test')
| -rw-r--r-- | mysql-test/main/partition.test | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test index 7b7d1457426..42929796f6b 100644 --- a/mysql-test/main/partition.test +++ b/mysql-test/main/partition.test @@ -2901,6 +2901,68 @@ DEALLOCATE PREPARE stmt; DROP TABLE t1; --echo # +--echo # MDEV-17032: Estimates are higher for partitions of a table with @@use_stat_tables= PREFERABLY +--echo # + +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; + + +create table t2 ( + part_key int, + a int, + b int +) partition by list(part_key) ( + partition p0 values in (0), + partition p1 values in (1), + partition p2 values in (2), + partition p3 values in (3), + partition p4 values in (4) +); +insert into t2 +select mod(a,5), a/100, mod(a,5) from t1; + +set @save_use_stat_tables= @@use_stat_tables; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +--echo # +--echo # Tests using stats provided by the storage engine +--echo # +explain extended select * from t2 where part_key=1; +explain partitions select * from t2 where part_key=1; +explain extended select * from t2 where part_key in (1,2); +explain partitions select * from t2 where part_key in (1,2); +explain extended select * from t2 where b=5; +explain partitions select * from t2 where b=5; +explain extended select * from t2 partition(p0) where b=1; + + +set @save_histogram_size=@@histogram_size; +set @@histogram_size=100; +set @@use_stat_tables= PREFERABLY; +set @@optimizer_use_condition_selectivity=4; +analyze table t2; +--echo # +--echo # Tests using EITS +--echo # +--echo # filtered should be 100 +explain extended select * from t2 where part_key=1; +explain partitions select * from t2 where part_key=1; +--echo # filtered should be 100 +explain extended select * from t2 where part_key in (1,2); +explain partitions select * from t2 where part_key in (1,2); +explain extended select * from t2 where b=5; +explain partitions select * from t2 where b=5; +explain extended select * from t2 partition(p0) where b=1; + +set @@use_stat_tables= @save_use_stat_tables; +set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set @@histogram_size= @save_histogram_size; +drop table t0,t1,t2; + +--echo # --echo # End of 10.0 tests --echo # |
