2020-09-07 16:23:59 +00:00
|
|
|
DROP TABLE IF EXISTS mt;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
CREATE TABLE mt (v UInt8) ENGINE = MergeTree() order by tuple();
|
2020-11-23 14:57:46 +00:00
|
|
|
SYSTEM STOP MERGES mt;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
INSERT INTO mt VALUES (0);
|
|
|
|
INSERT INTO mt VALUES (1);
|
|
|
|
INSERT INTO mt VALUES (2);
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT v FROM mt ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-11-03 09:24:10 +00:00
|
|
|
ALTER TABLE mt DETACH PART 'all_100_100_0'; -- { serverError 232 }
|
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
ALTER TABLE mt DETACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT v FROM mt ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
ALTER TABLE mt ATTACH PART 'all_2_2_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT v FROM mt ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT name FROM system.detached_parts WHERE table = 'mt';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
|
|
|
SELECT '-- drop part --';
|
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
ALTER TABLE mt DROP PART 'all_4_4_0';
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
ALTER TABLE mt ATTACH PART 'all_4_4_0'; -- { serverError 233 }
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT v FROM mt ORDER BY v;
|
2020-09-07 15:05:19 +00:00
|
|
|
|
2020-09-07 16:23:59 +00:00
|
|
|
SELECT '-- resume merges --';
|
2020-11-23 14:57:46 +00:00
|
|
|
SYSTEM START MERGES mt;
|
2020-09-07 16:23:59 +00:00
|
|
|
OPTIMIZE TABLE mt FINAL;
|
|
|
|
|
|
|
|
SELECT v FROM mt ORDER BY v;
|
|
|
|
|
|
|
|
SELECT name FROM system.parts WHERE table = 'mt' AND active;
|
|
|
|
|
|
|
|
DROP TABLE mt;
|