mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Moved the test cases for parallel execution from stat_tables.test
into a separate file stat_tables_par.test because the test cases could not be run with embedded server.
This commit is contained in:
@ -334,124 +334,6 @@ and o_orderkey=l_orderkey and p_partkey=l_partkey;
|
||||
o_orderkey p_partkey
|
||||
5895 200
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24 ;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
revenue
|
||||
77949.91860000002
|
||||
set use_stat_tables='preferably';
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
DROP DATABASE dbt3_s001;
|
||||
use test;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
@ -361,180 +361,6 @@ and o_orderkey=l_orderkey and p_partkey=l_partkey;
|
||||
o_orderkey p_partkey
|
||||
5895 200
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24 ;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
revenue
|
||||
77949.91860000002
|
||||
set use_stat_tables='preferably';
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 2 1.0364
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_commitdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey 2 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 3 1.0000
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_partkey 2 1.0089
|
||||
dbt3_s001 lineitem i_l_partkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_receiptdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_receiptdate 2 1.0152
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_shipdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_shipdate 2 1.0149
|
||||
dbt3_s001 lineitem i_l_suppkey 2 1.2073
|
||||
dbt3_s001 lineitem i_l_suppkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 3 1.0030
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 2 1.0364
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_commitdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey 2 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_partkey 2 1.0089
|
||||
dbt3_s001 lineitem i_l_partkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 2 1.2073
|
||||
dbt3_s001 lineitem i_l_suppkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 3 1.0030
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 2 1.0364
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_commitdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey 2 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 3 1.0000
|
||||
dbt3_s001 lineitem i_l_partkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_partkey 2 1.0089
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_shipdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_shipdate 2 1.0149
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 2 1.2073
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 3 1.0030
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 2 1.0364
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_commitdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey 2 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_partkey 2 1.0089
|
||||
dbt3_s001 lineitem i_l_partkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 2 1.2073
|
||||
dbt3_s001 lineitem i_l_suppkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 3 1.0030
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 2 1.0364
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_commitdate 3 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey 2 1.0000
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 3 1.0000
|
||||
dbt3_s001 lineitem i_l_partkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_partkey 2 1.0089
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 3 1.0000
|
||||
dbt3_s001 lineitem i_l_suppkey 2 1.2073
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 3 1.0030
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
|
||||
DROP DATABASE dbt3_s001;
|
||||
use test;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
|
167
mysql-test/r/stat_tables_par.result
Normal file
167
mysql-test/r/stat_tables_par.result
Normal file
@ -0,0 +1,167 @@
|
||||
set @save_use_stat_tables=@@use_stat_tables;
|
||||
set use_stat_tables='preferably';
|
||||
DROP DATABASE IF EXISTS dbt3_s001;
|
||||
CREATE DATABASE dbt3_s001;
|
||||
use dbt3_s001;
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
set optimizer_switch='extended_keys=off';
|
||||
select * from mysql.table_stat;
|
||||
db_name table_name cardinality
|
||||
dbt3_s001 customer 150
|
||||
dbt3_s001 lineitem 6005
|
||||
dbt3_s001 nation 25
|
||||
dbt3_s001 orders 1500
|
||||
dbt3_s001 part 200
|
||||
dbt3_s001 partsupp 700
|
||||
dbt3_s001 region 5
|
||||
dbt3_s001 supplier 10
|
||||
select * from mysql.index_stat;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 customer PRIMARY 1 1.0000
|
||||
dbt3_s001 customer i_c_nationkey 1 6.0000
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 nation PRIMARY 1 1.0000
|
||||
dbt3_s001 nation i_n_regionkey 1 5.0000
|
||||
dbt3_s001 orders PRIMARY 1 1.0000
|
||||
dbt3_s001 orders i_o_orderdate 1 1.3321
|
||||
dbt3_s001 orders i_o_custkey 1 15.0000
|
||||
dbt3_s001 part PRIMARY 1 1.0000
|
||||
dbt3_s001 partsupp PRIMARY 1 3.5000
|
||||
dbt3_s001 partsupp PRIMARY 2 1.0000
|
||||
dbt3_s001 partsupp i_ps_partkey 1 3.5000
|
||||
dbt3_s001 partsupp i_ps_suppkey 1 70.0000
|
||||
dbt3_s001 region PRIMARY 1 1.0000
|
||||
dbt3_s001 supplier PRIMARY 1 1.0000
|
||||
dbt3_s001 supplier i_s_nationkey 1 1.1111
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24 ;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
revenue
|
||||
77949.91860000002
|
||||
set use_stat_tables='preferably';
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
DROP DATABASE dbt3_s001;
|
||||
use test;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
172
mysql-test/r/stat_tables_par_innodb.result
Normal file
172
mysql-test/r/stat_tables_par_innodb.result
Normal file
@ -0,0 +1,172 @@
|
||||
SET SESSION STORAGE_ENGINE='InnoDB';
|
||||
set @save_optimizer_switch_for_stat_tables_test=@@optimizer_switch;
|
||||
set optimizer_switch='extended_keys=on';
|
||||
set @save_use_stat_tables=@@use_stat_tables;
|
||||
set use_stat_tables='preferably';
|
||||
DROP DATABASE IF EXISTS dbt3_s001;
|
||||
CREATE DATABASE dbt3_s001;
|
||||
use dbt3_s001;
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
set optimizer_switch='extended_keys=off';
|
||||
select * from mysql.table_stat;
|
||||
db_name table_name cardinality
|
||||
dbt3_s001 customer 150
|
||||
dbt3_s001 lineitem 6005
|
||||
dbt3_s001 nation 25
|
||||
dbt3_s001 orders 1500
|
||||
dbt3_s001 part 200
|
||||
dbt3_s001 partsupp 700
|
||||
dbt3_s001 region 5
|
||||
dbt3_s001 supplier 10
|
||||
select * from mysql.index_stat;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 customer PRIMARY 1 1.0000
|
||||
dbt3_s001 customer i_c_nationkey 1 6.0000
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 nation PRIMARY 1 1.0000
|
||||
dbt3_s001 nation i_n_regionkey 1 5.0000
|
||||
dbt3_s001 orders PRIMARY 1 1.0000
|
||||
dbt3_s001 orders i_o_orderdate 1 1.3321
|
||||
dbt3_s001 orders i_o_custkey 1 15.0000
|
||||
dbt3_s001 part PRIMARY 1 1.0000
|
||||
dbt3_s001 partsupp PRIMARY 1 3.5000
|
||||
dbt3_s001 partsupp PRIMARY 2 1.0000
|
||||
dbt3_s001 partsupp i_ps_partkey 1 3.5000
|
||||
dbt3_s001 partsupp i_ps_suppkey 1 70.0000
|
||||
dbt3_s001 region PRIMARY 1 1.0000
|
||||
dbt3_s001 supplier PRIMARY 1 1.0000
|
||||
dbt3_s001 supplier i_s_nationkey 1 1.1111
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24 ;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
revenue
|
||||
77949.91860000002
|
||||
revenue
|
||||
77949.91860000002
|
||||
set use_stat_tables='preferably';
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
|
||||
set debug_sync='RESET';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
db_name table_name index_name prefix_arity avg_frequency
|
||||
dbt3_s001 lineitem PRIMARY 1 4.0033
|
||||
dbt3_s001 lineitem PRIMARY 2 1.0000
|
||||
dbt3_s001 lineitem i_l_commitdate 1 2.7160
|
||||
dbt3_s001 lineitem i_l_orderkey 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 1 4.0033
|
||||
dbt3_s001 lineitem i_l_orderkey_quantity 2 1.0404
|
||||
dbt3_s001 lineitem i_l_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_receiptdate 1 2.6477
|
||||
dbt3_s001 lineitem i_l_shipdate 1 2.6500
|
||||
dbt3_s001 lineitem i_l_suppkey 1 600.5000
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
|
||||
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
|
||||
DROP DATABASE dbt3_s001;
|
||||
use test;
|
||||
set use_stat_tables=@save_use_stat_tables;
|
||||
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
|
||||
SET SESSION STORAGE_ENGINE=DEFAULT;
|
@ -1,5 +1,4 @@
|
||||
--source include/have_stat_tables.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
set @save_use_stat_tables=@@use_stat_tables;
|
||||
|
||||
@ -145,117 +144,6 @@ eval $QQ1;
|
||||
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
#
|
||||
# Test for parallel memory allocation for statistical data
|
||||
#
|
||||
# assumes that start the code of memory allocation for stats data has this line:
|
||||
#
|
||||
# DEBUG_SYNC(thd, "statistics_mem_alloc_start1");
|
||||
# DEBUG_SYNC(thd, "statistics_mem_alloc-start2");
|
||||
#
|
||||
|
||||
let $Q6=
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
eval $Q6;
|
||||
|
||||
connect (con1, localhost, root,,);
|
||||
connect (con2, localhost, root,,);
|
||||
|
||||
connection con1;
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send_eval $Q6
|
||||
|
||||
connection con2;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send_eval $Q6
|
||||
|
||||
connection con1;
|
||||
--reap
|
||||
|
||||
connection con2;
|
||||
--reap
|
||||
|
||||
connection default;
|
||||
set use_stat_tables='preferably';
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
set debug_sync='RESET';
|
||||
|
||||
#
|
||||
# Test for parallel statistics collection
|
||||
#
|
||||
# assumes that start of stats collection code has this line:
|
||||
#
|
||||
# DEBUG_SYNC(thd, "statistics_collection_start1");
|
||||
# DEBUG_SYNC(thd, "statistics_collection_start2");
|
||||
#
|
||||
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
|
||||
connect (con1, localhost, root,,);
|
||||
connect (con2, localhost, root,,);
|
||||
|
||||
connection con1;
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send analyze table lineitem persistent for columns() indexes (i_l_shipdate)
|
||||
|
||||
connection con2;
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send analyze table lineitem persistent for columns() indexes (i_l_receiptdate)
|
||||
|
||||
connection con1;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--reap
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
|
||||
connection con2;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--reap
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
|
||||
connection default;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
set debug_sync='RESET';
|
||||
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
|
||||
DROP DATABASE dbt3_s001;
|
||||
|
||||
|
153
mysql-test/t/stat_tables_par.test
Normal file
153
mysql-test/t/stat_tables_par.test
Normal file
@ -0,0 +1,153 @@
|
||||
--source include/have_stat_tables.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
set @save_use_stat_tables=@@use_stat_tables;
|
||||
|
||||
set use_stat_tables='preferably';
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS dbt3_s001;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE dbt3_s001;
|
||||
|
||||
use dbt3_s001;
|
||||
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
set optimizer_switch='extended_keys=off';
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--source include/dbt3_s001.inc
|
||||
delete from mysql.table_stat;
|
||||
delete from mysql.column_stat;
|
||||
delete from mysql.index_stat;
|
||||
ANALYZE TABLE
|
||||
customer, lineitem, nation, orders, part, partsupp, region, supplier;
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
select * from mysql.table_stat;
|
||||
select * from mysql.index_stat;
|
||||
|
||||
|
||||
#
|
||||
# Test for parallel memory allocation for statistical data
|
||||
#
|
||||
# assumes that start the code of memory allocation for stats data has this line:
|
||||
#
|
||||
# DEBUG_SYNC(thd, "statistics_mem_alloc_start1");
|
||||
# DEBUG_SYNC(thd, "statistics_mem_alloc-start2");
|
||||
#
|
||||
|
||||
let $Q6=
|
||||
select sum(l_extendedprice*l_discount) as revenue
|
||||
from lineitem
|
||||
where l_shipdate >= date '1994-01-01'
|
||||
and l_shipdate < date '1994-01-01' + interval '1' year
|
||||
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
|
||||
and l_quantity < 24;
|
||||
|
||||
flush table lineitem;
|
||||
set use_stat_tables='never';
|
||||
eval $Q6;
|
||||
|
||||
connect (con1, localhost, root,,);
|
||||
connect (con2, localhost, root,,);
|
||||
|
||||
connection con1;
|
||||
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send_eval $Q6
|
||||
|
||||
connection con2;
|
||||
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send_eval $Q6
|
||||
|
||||
connection con1;
|
||||
--reap
|
||||
|
||||
connection con2;
|
||||
--reap
|
||||
|
||||
connection default;
|
||||
set use_stat_tables='preferably';
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
set debug_sync='RESET';
|
||||
|
||||
#
|
||||
# Test for parallel statistics collection
|
||||
#
|
||||
# assumes that start of stats collection code has this line:
|
||||
#
|
||||
# DEBUG_SYNC(thd, "statistics_collection_start1");
|
||||
# DEBUG_SYNC(thd, "statistics_collection_start2");
|
||||
#
|
||||
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and
|
||||
index_name in ('i_l_shipdate', 'i_l_receiptdate');
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
delete from mysql.index_stat
|
||||
where table_name='lineitem' and index_name= 'i_l_shipdate';
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
|
||||
connect (con1, localhost, root,,);
|
||||
connect (con2, localhost, root,,);
|
||||
|
||||
connection con1;
|
||||
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send analyze table lineitem persistent for columns() indexes (i_l_shipdate)
|
||||
|
||||
connection con2;
|
||||
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
|
||||
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
|
||||
use dbt3_s001;
|
||||
set use_stat_tables='preferably';
|
||||
--send analyze table lineitem persistent for columns() indexes (i_l_receiptdate)
|
||||
|
||||
connection con1;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--reap
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
|
||||
connection con2;
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--reap
|
||||
--enable_warnings
|
||||
--enable_result_log
|
||||
|
||||
connection default;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
set debug_sync='RESET';
|
||||
|
||||
select * from mysql.index_stat where table_name='lineitem' order by index_name;
|
||||
|
||||
DROP DATABASE dbt3_s001;
|
||||
|
||||
use test;
|
||||
|
||||
set use_stat_tables=@save_use_stat_tables;
|
12
mysql-test/t/stat_tables_par_innodb.test
Normal file
12
mysql-test/t/stat_tables_par_innodb.test
Normal file
@ -0,0 +1,12 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
SET SESSION STORAGE_ENGINE='InnoDB';
|
||||
|
||||
set @save_optimizer_switch_for_stat_tables_test=@@optimizer_switch;
|
||||
set optimizer_switch='extended_keys=on';
|
||||
|
||||
--source stat_tables_par.test
|
||||
|
||||
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
|
||||
|
||||
SET SESSION STORAGE_ENGINE=DEFAULT;
|
Reference in New Issue
Block a user