summaryrefslogtreecommitdiff
path: root/mysql-test/r/selectivity_innodb.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-03-30 18:57:07 -0700
committerIgor Babaev <igor@askmonty.org>2013-03-30 18:57:07 -0700
commit9e1ca1053b5e619e1f6c727abdf787dc163ab4e6 (patch)
treee8c3a439fd6c693e9035bc699eeb0c27d912b272 /mysql-test/r/selectivity_innodb.result
parente59e529635f5a033aff905e95a901b17fe0f9833 (diff)
downloadmariadb-git-9e1ca1053b5e619e1f6c727abdf787dc163ab4e6.tar.gz
Added the type of histogram for mwl #253.
Introduced double precision height-balanced histograms.
Diffstat (limited to 'mysql-test/r/selectivity_innodb.result')
-rw-r--r--mysql-test/r/selectivity_innodb.result66
1 files changed, 64 insertions, 2 deletions
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index 9ececad3492..d90fe9f6379 100644
--- a/mysql-test/r/selectivity_innodb.result
+++ b/mysql-test/r/selectivity_innodb.result
@@ -14,6 +14,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;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -63,6 +64,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
@@ -114,10 +119,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 OK
+flush table part;
set optimizer_use_condition_selectivity=4;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
@@ -168,11 +173,67 @@ 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 OK
+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 <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 6.25 Using where
+2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+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 14.37 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_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 OK
+flush table nation;
EXPLAIN EXTENDED select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -223,6 +284,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;