4
20G
1
2000000000
10G
engine
Memory
MergeTree ORDER BY tuple()
type
Int32
Int32 NULL
CREATE TABLE `zz_{type}_{engine}` (x {type}) ENGINE {engine}
INSERT INTO `zz_{type}_{engine}` SELECT rand() FROM numbers_mt(1000000000) SETTINGS max_insert_threads = 8
OPTIMIZE TABLE `zz_{type}_MergeTree ORDER BY tuple()` FINAL
SELECT sum(x) FROM `zz_{type}_{engine}`
DROP TABLE IF EXISTS `zz_{type}_{engine}`