2019-09-26 14:44:04 +00:00
|
|
|
DROP TABLE IF EXISTS new_table_test;
|
2019-09-26 12:06:52 +00:00
|
|
|
DROP TABLE IF EXISTS check_table_test;
|
|
|
|
|
2019-09-26 14:44:04 +00:00
|
|
|
CREATE TABLE new_table_test(name String) ENGINE = MergeTree ORDER BY name;
|
|
|
|
INSERT INTO new_table_test VALUES ('test');
|
|
|
|
CREATE TABLE check_table_test(value1 UInt64, value2 UInt64) ENGINE = MergeTree ORDER BY tuple();
|
|
|
|
INSERT INTO check_table_test (value1) SELECT value FROM system.events WHERE event = 'Merge';
|
2019-09-26 12:06:52 +00:00
|
|
|
OPTIMIZE TABLE new_table_test FINAL;
|
2019-09-26 14:44:04 +00:00
|
|
|
INSERT INTO check_table_test (value2) SELECT value FROM system.events WHERE event = 'Merge';
|
2019-09-26 12:06:52 +00:00
|
|
|
SELECT count() FROM check_table_test WHERE value2 > value1;
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE new_table_test;
|
|
|
|
DROP TABLE check_table_test;
|