2021-01-20 05:27:42 +00:00
|
|
|
DROP TABLE IF EXISTS mt_01451;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2023-01-16 15:01:01 +00:00
|
|
|
CREATE TABLE mt_01451 (v UInt8) ENGINE = MergeTree() order by tuple() SETTINGS old_parts_lifetime=0;
|
2021-01-20 05:27:42 +00:00
|
|
|
SYSTEM STOP MERGES mt_01451;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
INSERT INTO mt_01451 VALUES (0);
|
|
|
|
INSERT INTO mt_01451 VALUES (1);
|
|
|
|
INSERT INTO mt_01451 VALUES (2);
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE mt_01451 DETACH PART 'all_100_100_0'; -- { serverError NO_SUCH_DATA_PART }
|
2020-11-03 09:24:10 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 DETACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-05-22 05:43:24 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt_01451' AND database = currentDatabase();
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 ATTACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-05-22 05:43:24 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt_01451' AND database = currentDatabase();
|
2020-09-07 15:05:19 +00:00
|
|
|
|
|
|
|
SELECT '-- drop part --';
|
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
ALTER TABLE mt_01451 DROP PART 'all_4_4_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE mt_01451 ATTACH PART 'all_4_4_0'; -- { serverError BAD_DATA_PART_NAME }
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2022-09-12 10:41:34 +00:00
|
|
|
SELECT name FROM system.parts WHERE table = 'mt_01451' AND active AND database = currentDatabase();
|
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT '-- resume merges --';
|
2021-01-20 05:27:42 +00:00
|
|
|
SYSTEM START MERGES mt_01451;
|
|
|
|
OPTIMIZE TABLE mt_01451 FINAL;
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
SELECT v FROM mt_01451 ORDER BY v;
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-05-22 05:43:24 +00:00
|
|
|
SELECT name FROM system.parts WHERE table = 'mt_01451' AND active AND database = currentDatabase();
|
2020-09-07 16:23:59 +00:00
|
|
|
|
2021-01-20 05:27:42 +00:00
|
|
|
DROP TABLE mt_01451;
|