mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
added test for MultiversionMergeTree [#CLICKHOUSE-3479]
This commit is contained in:
parent
66b94d481a
commit
db0692eb7c
@ -0,0 +1,261 @@
|
|||||||
|
table with 2 blocks final
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
#########################
|
||||||
|
table with 2 blocks final
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
#########################
|
||||||
|
table with 2 blocks final
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 0 -1
|
||||||
|
#########################
|
||||||
|
table with 2 blocks final
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_0 1 1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_1 1 -1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_2 1 1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_3 1 -1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_4 1 1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_5 1 -1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_6 1 1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_7 1 -1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_8 1 1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 1 -1
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 str_0 0 -1
|
||||||
|
2018-01-31 str_0 1 1
|
||||||
|
2018-01-31 str_1 0 1
|
||||||
|
2018-01-31 str_1 1 -1
|
||||||
|
2018-01-31 str_2 0 -1
|
||||||
|
2018-01-31 str_2 1 1
|
||||||
|
2018-01-31 str_3 0 1
|
||||||
|
2018-01-31 str_3 1 -1
|
||||||
|
2018-01-31 str_4 0 -1
|
||||||
|
2018-01-31 str_4 1 1
|
||||||
|
2018-01-31 str_5 0 1
|
||||||
|
2018-01-31 str_5 1 -1
|
||||||
|
2018-01-31 str_6 0 -1
|
||||||
|
2018-01-31 str_6 1 1
|
||||||
|
2018-01-31 str_7 0 1
|
||||||
|
2018-01-31 str_7 1 -1
|
||||||
|
2018-01-31 str_8 0 -1
|
||||||
|
2018-01-31 str_8 1 1
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 1 -1
|
||||||
|
#########################
|
||||||
|
table with 4 blocks final
|
||||||
|
table with 4 blocks optimized
|
||||||
|
2018-01-31 str_9 0 1
|
||||||
|
2018-01-31 str_9 0 -1
|
||||||
|
#########################
|
||||||
|
table with 5 blocks final
|
||||||
|
2018-01-31 str_0 1 -1
|
||||||
|
2018-01-31 str_1 1 -1
|
||||||
|
2018-01-31 str_2 1 -1
|
||||||
|
2018-01-31 str_3 1 -1
|
||||||
|
2018-01-31 str_4 1 -1
|
||||||
|
2018-01-31 str_5 1 -1
|
||||||
|
2018-01-31 str_6 1 -1
|
||||||
|
2018-01-31 str_7 1 -1
|
||||||
|
2018-01-31 str_8 1 -1
|
||||||
|
2018-01-31 str_9 1 -1
|
||||||
|
table with 5 blocks optimized
|
||||||
|
2018-01-31 str_0 1 -1
|
||||||
|
2018-01-31 str_1 1 -1
|
||||||
|
2018-01-31 str_2 1 -1
|
||||||
|
2018-01-31 str_3 1 -1
|
||||||
|
2018-01-31 str_4 1 -1
|
||||||
|
2018-01-31 str_5 1 -1
|
||||||
|
2018-01-31 str_6 1 -1
|
||||||
|
2018-01-31 str_7 1 -1
|
||||||
|
2018-01-31 str_8 1 -1
|
||||||
|
2018-01-31 str_9 1 -1
|
||||||
|
#########################
|
||||||
|
table with 2 blocks final
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 str_999999 0 1
|
||||||
|
2018-01-31 str_999999 0 -1
|
||||||
|
#########################
|
||||||
|
table with 2 blocks final
|
||||||
|
2018-01-31 0 0 1
|
||||||
|
2018-01-31 1 0 1
|
||||||
|
2018-01-31 2 0 1
|
||||||
|
2018-01-31 3 0 1
|
||||||
|
2018-01-31 4 0 1
|
||||||
|
2018-01-31 5 0 1
|
||||||
|
2018-01-31 6 0 1
|
||||||
|
2018-01-31 7 0 1
|
||||||
|
2018-01-31 8 0 1
|
||||||
|
2018-01-31 9 0 1
|
||||||
|
2018-01-31 10 0 1
|
||||||
|
2018-01-31 11 0 1
|
||||||
|
2018-01-31 12 0 1
|
||||||
|
2018-01-31 13 0 1
|
||||||
|
2018-01-31 14 0 1
|
||||||
|
2018-01-31 15 0 1
|
||||||
|
2018-01-31 16 0 1
|
||||||
|
2018-01-31 17 0 1
|
||||||
|
2018-01-31 18 0 1
|
||||||
|
2018-01-31 19 0 1
|
||||||
|
2018-01-31 20 0 1
|
||||||
|
2018-01-31 21 0 1
|
||||||
|
2018-01-31 22 0 1
|
||||||
|
2018-01-31 23 0 1
|
||||||
|
2018-01-31 24 0 1
|
||||||
|
2018-01-31 25 0 1
|
||||||
|
2018-01-31 26 0 1
|
||||||
|
2018-01-31 27 0 1
|
||||||
|
2018-01-31 28 0 1
|
||||||
|
2018-01-31 29 0 1
|
||||||
|
2018-01-31 30 0 1
|
||||||
|
2018-01-31 31 0 1
|
||||||
|
2018-01-31 64 0 -1
|
||||||
|
2018-01-31 65 0 -1
|
||||||
|
2018-01-31 66 0 -1
|
||||||
|
2018-01-31 67 0 -1
|
||||||
|
2018-01-31 68 0 -1
|
||||||
|
2018-01-31 69 0 -1
|
||||||
|
2018-01-31 70 0 -1
|
||||||
|
2018-01-31 71 0 -1
|
||||||
|
2018-01-31 72 0 -1
|
||||||
|
2018-01-31 73 0 -1
|
||||||
|
2018-01-31 74 0 -1
|
||||||
|
2018-01-31 75 0 -1
|
||||||
|
2018-01-31 76 0 -1
|
||||||
|
2018-01-31 77 0 -1
|
||||||
|
2018-01-31 78 0 -1
|
||||||
|
2018-01-31 79 0 -1
|
||||||
|
2018-01-31 80 0 -1
|
||||||
|
2018-01-31 81 0 -1
|
||||||
|
2018-01-31 82 0 -1
|
||||||
|
2018-01-31 83 0 -1
|
||||||
|
2018-01-31 84 0 -1
|
||||||
|
2018-01-31 85 0 -1
|
||||||
|
2018-01-31 86 0 -1
|
||||||
|
2018-01-31 87 0 -1
|
||||||
|
2018-01-31 88 0 -1
|
||||||
|
2018-01-31 89 0 -1
|
||||||
|
2018-01-31 90 0 -1
|
||||||
|
2018-01-31 91 0 -1
|
||||||
|
2018-01-31 92 0 -1
|
||||||
|
2018-01-31 93 0 -1
|
||||||
|
2018-01-31 94 0 -1
|
||||||
|
2018-01-31 95 0 -1
|
||||||
|
2018-01-31 0 0 -1
|
||||||
|
2018-01-31 1 0 -1
|
||||||
|
2018-01-31 2 0 -1
|
||||||
|
2018-01-31 3 0 -1
|
||||||
|
2018-01-31 4 0 -1
|
||||||
|
2018-01-31 5 0 -1
|
||||||
|
2018-01-31 6 0 -1
|
||||||
|
2018-01-31 7 0 -1
|
||||||
|
2018-01-31 8 0 -1
|
||||||
|
2018-01-31 9 0 -1
|
||||||
|
2018-01-31 10 0 -1
|
||||||
|
2018-01-31 11 0 -1
|
||||||
|
2018-01-31 12 0 -1
|
||||||
|
2018-01-31 13 0 -1
|
||||||
|
2018-01-31 14 0 -1
|
||||||
|
2018-01-31 15 0 -1
|
||||||
|
2018-01-31 16 0 -1
|
||||||
|
2018-01-31 17 0 -1
|
||||||
|
2018-01-31 18 0 -1
|
||||||
|
2018-01-31 19 0 -1
|
||||||
|
2018-01-31 20 0 -1
|
||||||
|
2018-01-31 21 0 -1
|
||||||
|
2018-01-31 22 0 -1
|
||||||
|
2018-01-31 23 0 -1
|
||||||
|
2018-01-31 24 0 -1
|
||||||
|
2018-01-31 25 0 -1
|
||||||
|
2018-01-31 26 0 -1
|
||||||
|
2018-01-31 27 0 -1
|
||||||
|
2018-01-31 28 0 -1
|
||||||
|
2018-01-31 29 0 -1
|
||||||
|
2018-01-31 30 0 -1
|
||||||
|
2018-01-31 31 0 -1
|
||||||
|
2018-01-31 64 0 1
|
||||||
|
2018-01-31 65 0 1
|
||||||
|
2018-01-31 66 0 1
|
||||||
|
2018-01-31 67 0 1
|
||||||
|
2018-01-31 68 0 1
|
||||||
|
2018-01-31 69 0 1
|
||||||
|
2018-01-31 70 0 1
|
||||||
|
2018-01-31 71 0 1
|
||||||
|
2018-01-31 72 0 1
|
||||||
|
2018-01-31 73 0 1
|
||||||
|
2018-01-31 74 0 1
|
||||||
|
2018-01-31 75 0 1
|
||||||
|
2018-01-31 76 0 1
|
||||||
|
2018-01-31 77 0 1
|
||||||
|
2018-01-31 78 0 1
|
||||||
|
2018-01-31 79 0 1
|
||||||
|
2018-01-31 80 0 1
|
||||||
|
2018-01-31 81 0 1
|
||||||
|
2018-01-31 82 0 1
|
||||||
|
2018-01-31 83 0 1
|
||||||
|
2018-01-31 84 0 1
|
||||||
|
2018-01-31 85 0 1
|
||||||
|
2018-01-31 86 0 1
|
||||||
|
2018-01-31 87 0 1
|
||||||
|
2018-01-31 88 0 1
|
||||||
|
2018-01-31 89 0 1
|
||||||
|
2018-01-31 90 0 1
|
||||||
|
2018-01-31 91 0 1
|
||||||
|
2018-01-31 92 0 1
|
||||||
|
2018-01-31 93 0 1
|
||||||
|
2018-01-31 94 0 1
|
||||||
|
2018-01-31 95 0 1
|
||||||
|
table with 2 blocks optimized
|
||||||
|
2018-01-31 0 0 -1
|
||||||
|
2018-01-31 127 0 1
|
@ -0,0 +1,98 @@
|
|||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, date, 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, -1, 1) from system.numbers limit 10;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 1, if(number % 2, -1, 1) from system.numbers limit 10;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, -1, 1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, -1, 1) from system.numbers limit 10;
|
||||||
|
select 'table with 4 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 4 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, -1, 1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 1, if(number % 3 = 0, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 1, if(number % 3 = 1, 1, -1) from system.numbers limit 10;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 1, if(number % 3 = 2, 1, -1) from system.numbers limit 10;
|
||||||
|
select 'table with 5 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 5 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value String, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date, value), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, 1, -1) from system.numbers limit 1000000;
|
||||||
|
insert into test.mult_tab select '2018-01-31', 'str_' || toString(number), 0, if(number % 2, -1, 1) from system.numbers limit 1000000;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
||||||
|
|
||||||
|
select '#########################';
|
||||||
|
|
||||||
|
drop table if exists test.mult_tab;
|
||||||
|
create table test.mult_tab (date Date, value UInt64, version UInt64, sign Int8) engine = MultiversionMergeTree(date, (date), 8192, sign, version);
|
||||||
|
insert into test.mult_tab select '2018-01-31', number, 0, if(number < 64, 1, -1) from system.numbers limit 128;
|
||||||
|
insert into test.mult_tab select '2018-01-31', number, 0, if(number < 64, -1, 1) from system.numbers limit 128;
|
||||||
|
select 'table with 2 blocks final';
|
||||||
|
select * from test.mult_tab final settings max_block_size=32;
|
||||||
|
optimize table test.mult_tab;
|
||||||
|
select 'table with 2 blocks optimized';
|
||||||
|
select * from test.mult_tab;
|
Loading…
Reference in New Issue
Block a user