ClickHouse/tests/queries/0_stateless/00341_squashing_insert_select2.sql

69 lines
1.8 KiB
MySQL
Raw Normal View History

DROP TABLE IF EXISTS numbers_squashed;
CREATE TABLE numbers_squashed (number UInt8) ENGINE = Memory;
2016-07-01 21:25:14 +00:00
SET min_insert_block_size_rows = 100;
SET min_insert_block_size_bytes = 0;
2016-07-07 05:13:08 +00:00
SET max_threads = 1;
2016-07-01 21:25:14 +00:00
INSERT INTO numbers_squashed
2016-07-01 21:25:14 +00:00
SELECT arrayJoin(range(10)) AS number
UNION ALL
SELECT arrayJoin(range(100))
UNION ALL
SELECT arrayJoin(range(10));
SELECT blockSize() AS b, count() / b AS c FROM numbers_squashed GROUP BY blockSize() ORDER BY c DESC, b ASC;
SELECT count() FROM numbers_squashed;
2016-07-01 21:25:14 +00:00
INSERT INTO numbers_squashed
2016-07-01 21:25:14 +00:00
SELECT arrayJoin(range(100)) AS number
UNION ALL
SELECT arrayJoin(range(10))
UNION ALL
SELECT arrayJoin(range(100));
SELECT blockSize() AS b, count() / b AS c FROM numbers_squashed GROUP BY blockSize() ORDER BY c DESC, b ASC;
SELECT count() FROM numbers_squashed;
2016-07-01 21:25:14 +00:00
INSERT INTO numbers_squashed
2016-07-01 21:25:14 +00:00
SELECT arrayJoin(range(10)) AS number
UNION ALL
SELECT arrayJoin(range(100))
UNION ALL
SELECT arrayJoin(range(100));
SELECT blockSize() AS b, count() / b AS c FROM numbers_squashed GROUP BY blockSize() ORDER BY c DESC, b ASC;
SELECT count() FROM numbers_squashed;
2016-07-01 21:25:14 +00:00
INSERT INTO numbers_squashed
2016-07-01 21:25:14 +00:00
SELECT arrayJoin(range(10)) AS number
UNION ALL
SELECT arrayJoin(range(10))
UNION ALL
SELECT arrayJoin(range(10))
UNION ALL
SELECT arrayJoin(range(100))
UNION ALL
SELECT arrayJoin(range(10));
SELECT blockSize() AS b, count() / b AS c FROM numbers_squashed GROUP BY blockSize() ORDER BY c DESC, b ASC;
SELECT count() FROM numbers_squashed;
2016-07-01 21:25:14 +00:00
SET min_insert_block_size_rows = 10;
INSERT INTO numbers_squashed
2016-07-01 21:25:14 +00:00
SELECT arrayJoin(range(10)) AS number
UNION ALL
SELECT arrayJoin(range(10))
UNION ALL
SELECT arrayJoin(range(10))
UNION ALL
SELECT arrayJoin(range(100))
UNION ALL
SELECT arrayJoin(range(10));
SELECT blockSize() AS b, count() / b AS c FROM numbers_squashed GROUP BY blockSize() ORDER BY c DESC, b ASC;
SELECT count() FROM numbers_squashed;
2016-07-01 21:25:14 +00:00
DROP TABLE numbers_squashed;