2019-07-16 10:19:37 +00:00
|
|
|
SET check_query_single_value_result = 0;
|
2019-07-09 09:02:52 +00:00
|
|
|
DROP TABLE IF EXISTS mt_table;
|
|
|
|
|
|
|
|
CREATE TABLE mt_table (d Date, key UInt64, data String) ENGINE = MergeTree() PARTITION BY toYYYYMM(d) ORDER BY key;
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
2023-10-23 12:13:36 +00:00
|
|
|
INSERT INTO mt_table VALUES (toDate('2018-01-01'), 1, 'old');
|
|
|
|
|
2019-07-09 09:02:52 +00:00
|
|
|
INSERT INTO mt_table VALUES (toDate('2019-01-02'), 1, 'Hello'), (toDate('2019-01-02'), 2, 'World');
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
|
|
|
INSERT INTO mt_table VALUES (toDate('2019-01-02'), 3, 'quick'), (toDate('2019-01-02'), 4, 'brown');
|
|
|
|
|
|
|
|
SELECT '========';
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
|
|
|
OPTIMIZE TABLE mt_table FINAL;
|
|
|
|
|
|
|
|
SELECT '========';
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
|
|
|
SELECT '========';
|
|
|
|
|
|
|
|
INSERT INTO mt_table VALUES (toDate('2019-02-03'), 5, '!'), (toDate('2019-02-03'), 6, '?');
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
|
|
|
SELECT '========';
|
|
|
|
|
|
|
|
INSERT INTO mt_table VALUES (toDate('2019-02-03'), 7, 'jump'), (toDate('2019-02-03'), 8, 'around');
|
|
|
|
|
|
|
|
OPTIMIZE TABLE mt_table FINAL;
|
|
|
|
|
2023-08-14 09:58:08 +00:00
|
|
|
CHECK TABLE mt_table PARTITION 201902 SETTINGS max_threads = 1;
|
2019-07-09 09:02:52 +00:00
|
|
|
|
2023-10-23 12:13:36 +00:00
|
|
|
SELECT '========';
|
|
|
|
|
2024-08-14 09:52:12 +00:00
|
|
|
CHECK TABLE mt_table PART '201801_1_1_2';
|
2023-10-23 12:13:36 +00:00
|
|
|
|
2019-07-09 09:02:52 +00:00
|
|
|
DROP TABLE IF EXISTS mt_table;
|