diff options
author | unknown <sanja@askmonty.org> | 2013-04-18 22:22:04 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-04-18 22:22:04 +0300 |
commit | 9441e536535af3e71aaa81801645ab42bd07e89f (patch) | |
tree | 4479a5d77e53380b7bd2d9b3d4db3c271ea6b40a /mysql-test/t/selectivity.test | |
parent | 8c71e7a38358c79e1b5b9072fa7407cec3cfd273 (diff) | |
download | mariadb-git-9441e536535af3e71aaa81801645ab42bd07e89f.tar.gz |
MDEV-4345
Sampling of selectivity of LIKE predicate.
Diffstat (limited to 'mysql-test/t/selectivity.test')
-rw-r--r-- | mysql-test/t/selectivity.test | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index 56908e50c65..8bde4718fdd 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -56,6 +56,64 @@ customer, lineitem, nation, orders, part, partsupp, region, supplier; --enable_result_log --enable_query_log +--echo === Q2 === + +set optimizer_use_condition_selectivity=5; +explain extended +select + s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment +from + part, supplier, partsupp, nation, region +where + p_partkey = ps_partkey + and s_suppkey = ps_suppkey + and p_size = 9 + and p_type like '%TIN' + and s_nationkey = n_nationkey + and n_regionkey = r_regionkey + and r_name = 'ASIA' + and ps_supplycost = ( + select + min(ps_supplycost) + from + partsupp, supplier, nation, region + where + p_partkey = ps_partkey + and s_suppkey = ps_suppkey + and s_nationkey = n_nationkey + and n_regionkey = r_regionkey + and r_name = 'ASIA' + ) +order by + s_acctbal desc, n_name, s_name, p_partkey; +set optimizer_use_condition_selectivity=4; +explain extended +select + s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment +from + part, supplier, partsupp, nation, region +where + p_partkey = ps_partkey + and s_suppkey = ps_suppkey + and p_size = 9 + and p_type like '%TIN' + and s_nationkey = n_nationkey + and n_regionkey = r_regionkey + and r_name = 'ASIA' + and ps_supplycost = ( + select + min(ps_supplycost) + from + partsupp, supplier, nation, region + where + p_partkey = ps_partkey + and s_suppkey = ps_suppkey + and s_nationkey = n_nationkey + and n_regionkey = r_regionkey + and r_name = 'ASIA' + ) +order by + s_acctbal desc, n_name, s_name, p_partkey; --echo === Q15 === @@ -230,7 +288,6 @@ flush table nation; eval EXPLAIN EXTENDED $Q20; eval $Q20; - DROP DATABASE dbt3_s001; set histogram_type=@save_histogram_type; |