summaryrefslogtreecommitdiff
path: root/mysql-test/r/selectivity.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-03-30 22:00:04 -0700
committerIgor Babaev <igor@askmonty.org>2013-03-30 22:00:04 -0700
commit78bab7839502e02d6d62b50d99ac9b0637acb4a1 (patch)
treedd345c47c4d9a55e1061697151b9e6d38b2a5e07 /mysql-test/r/selectivity.result
parent905549863454647b6070e23b7cf5fc1394f92750 (diff)
parent9e1ca1053b5e619e1f6c727abdf787dc163ab4e6 (diff)
downloadmariadb-git-78bab7839502e02d6d62b50d99ac9b0637acb4a1.tar.gz
Merge
Diffstat (limited to 'mysql-test/r/selectivity.result')
-rw-r--r--mysql-test/r/selectivity.result65
1 files changed, 63 insertions, 2 deletions
diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result
index 77a26bc21f1..3b56046ae19 100644
--- a/mysql-test/r/selectivity.result
+++ b/mysql-test/r/selectivity.result
@@ -11,6 +11,7 @@ CREATE DATABASE dbt3_s001;
use dbt3_s001;
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
set @save_histogram_size=@@histogram_size;
+set @save_histogram_type=@@histogram_type;
=== Q15 ===
create view revenue0 (supplier_no, total_revenue) as
select l_suppkey, sum(l_extendedprice * (1 - l_discount))
@@ -401,6 +402,10 @@ order by s_name
limit 10;
s_name s_address
Supplier#000000010 Saygah3gYWMp72i PY
+SELECT ((SELECT COUNT(*) FROM part WHERE p_name LIKE 'g%') /
+(SELECT COUNT(*) FROM part)) AS sel;
+sel
+0.0600
set optimizer_use_condition_selectivity=3;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
@@ -452,10 +457,10 @@ limit 10;
s_name s_address
Supplier#000000010 Saygah3gYWMp72i PY
set histogram_size=15;
-flush table part;
ANALYZE TABLE part PERSISTENT FOR COLUMNS(p_name) INDEXES();
Table Op Msg_type Msg_text
dbt3_s001.part analyze status Table is already up to date
+flush table part;
set optimizer_use_condition_selectivity=4;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
@@ -505,11 +510,66 @@ order by s_name
limit 10;
s_name s_address
Supplier#000000010 Saygah3gYWMp72i PY
+set histogram_type='DOUBLE_PREC_HB';
+set histogram_size=30;
+ANALYZE TABLE part PERSISTENT FOR COLUMNS(p_name) INDEXES();
+Table Op Msg_type Msg_text
+dbt3_s001.part analyze status Table is already up to date
+flush table part;
+EXPLAIN EXTENDED select sql_calc_found_rows
+s_name, s_address
+from supplier, nation
+where s_suppkey in (select ps_suppkey from partsupp
+where ps_partkey in (select p_partkey from part
+where p_name like 'g%')
+and ps_availqty >
+(select 0.5 * sum(l_quantity)
+from lineitem
+where l_partkey = ps_partkey
+and l_suppkey = ps_suppkey
+and l_shipdate >= date('1993-01-01')
+and l_shipdate < date('1993-01-01') +
+interval '1' year ))
+and s_nationkey = n_nationkey
+and n_name = 'UNITED STATES'
+order by s_name
+limit 10;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 6.25 Using where
+1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where; FirstMatch(supplier)
+4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
+Warnings:
+Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
+Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
+Note 1003 select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where ((`dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey`) and (`dbt3_s001`.`nation`.`n_name` = 'UNITED STATES') and (`dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey`) and (`dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((select (0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`)) from `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`) and (`dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey`) and (`dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date))) and (`dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>((cast('1993-01-01' as date) + interval '1' year))))))) and (`dbt3_s001`.`part`.`p_name` like 'g%')) order by `dbt3_s001`.`supplier`.`s_name` limit 10
+select sql_calc_found_rows
+s_name, s_address
+from supplier, nation
+where s_suppkey in (select ps_suppkey from partsupp
+where ps_partkey in (select p_partkey from part
+where p_name like 'g%')
+and ps_availqty >
+(select 0.5 * sum(l_quantity)
+from lineitem
+where l_partkey = ps_partkey
+and l_suppkey = ps_suppkey
+and l_shipdate >= date('1993-01-01')
+and l_shipdate < date('1993-01-01') +
+interval '1' year ))
+and s_nationkey = n_nationkey
+and n_name = 'UNITED STATES'
+order by s_name
+limit 10;
+s_name s_address
+Supplier#000000010 Saygah3gYWMp72i PY
+set histogram_type='SINGLE_PREC_HB';
set histogram_size=24;
-flush table nation;
ANALYZE TABLE nation PERSISTENT FOR COLUMNS(n_name) INDEXES();
Table Op Msg_type Msg_text
dbt3_s001.nation analyze status Table is already up to date
+flush table nation;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -559,6 +619,7 @@ limit 10;
s_name s_address
Supplier#000000010 Saygah3gYWMp72i PY
DROP DATABASE dbt3_s001;
+set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;