diff options
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; |