mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: added test for merges [#METR-19025].
This commit is contained in:
parent
fb88629d67
commit
7e5b79fbe9
394
dbms/tests/queries/0_stateless/00282_merging.reference
Normal file
394
dbms/tests/queries/0_stateless/00282_merging.reference
Normal file
@ -0,0 +1,394 @@
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 100
|
||||
2000-01-01 101
|
||||
2000-01-01 102
|
||||
2000-01-01 103
|
||||
2000-01-01 104
|
||||
2000-01-01 105
|
||||
2000-01-01 106
|
||||
2000-01-01 107
|
||||
2000-01-01 108
|
||||
2000-01-01 109
|
||||
2000-01-01 0
|
||||
2000-01-01 1
|
||||
2000-01-01 2
|
||||
2000-01-01 3
|
||||
2000-01-01 4
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 5
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 6
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 7
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 8
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 9
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 10
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 11
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 12
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 13
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 14
|
||||
2000-01-01 15
|
||||
2000-01-01 16
|
||||
2000-01-01 17
|
||||
2000-01-01 18
|
||||
2000-01-01 19
|
||||
2000-01-01 100
|
||||
2000-01-01 101
|
||||
2000-01-01 102
|
||||
2000-01-01 103
|
||||
2000-01-01 104
|
||||
2000-01-01 105
|
||||
2000-01-01 106
|
||||
2000-01-01 107
|
||||
2000-01-01 108
|
||||
2000-01-01 109
|
||||
16400 8200 0 8199 67231800 4574870733220668470
|
||||
20000 15000 0 14999 149990000 5561824225056413482
|
99
dbms/tests/queries/0_stateless/00282_merging.sql
Normal file
99
dbms/tests/queries/0_stateless/00282_merging.sql
Normal file
@ -0,0 +1,99 @@
|
||||
DROP TABLE IF EXISTS test.merge;
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 5);
|
||||
|
||||
INSERT INTO test.merge (x) VALUES (1), (2), (3);
|
||||
INSERT INTO test.merge (x) VALUES (4), (5), (6);
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 5);
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number + 10 AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 5);
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number + 5 AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 5);
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number + 5 AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number + 9 AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 5);
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number + 5 AS x FROM system.numbers LIMIT 10;
|
||||
INSERT INTO test.merge (x) SELECT number + 10 AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number + 5 AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
INSERT INTO test.merge (x) SELECT number + 100 AS x FROM system.numbers LIMIT 10;
|
||||
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
OPTIMIZE TABLE test.merge;
|
||||
SELECT * FROM test.merge ORDER BY _part_index, x;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 8192);
|
||||
|
||||
SET max_block_size = 8200;
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM (SELECT * FROM system.numbers LIMIT 8200) ORDER BY rand();
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM (SELECT * FROM system.numbers LIMIT 8200) ORDER BY rand();
|
||||
|
||||
OPTIMIZE TABLE test.merge;
|
||||
|
||||
SELECT count(), uniqExact(x), min(x), max(x), sum(x), sum(cityHash64(x)) FROM test.merge;
|
||||
|
||||
DROP TABLE test.merge;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS test.merge (d Date DEFAULT '2000-01-01', x UInt64) ENGINE = MergeTree(d, x, 8192);
|
||||
|
||||
SET max_block_size = 10000;
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM (SELECT number FROM system.numbers LIMIT 10000);
|
||||
INSERT INTO test.merge (x) SELECT number AS x FROM (SELECT number + 5000 AS number FROM system.numbers LIMIT 10000);
|
||||
|
||||
OPTIMIZE TABLE test.merge;
|
||||
|
||||
SELECT count(), uniqExact(x), min(x), max(x), sum(x), sum(cityHash64(x)) FROM test.merge;
|
||||
|
||||
DROP TABLE test.merge;
|
Loading…
Reference in New Issue
Block a user