2020-03-19 11:31:21 +00:00
|
|
|
DROP TABLE IF EXISTS table_with_pk;
|
|
|
|
|
|
|
|
CREATE TABLE table_with_pk
|
|
|
|
(
|
|
|
|
key UInt8,
|
|
|
|
value String
|
|
|
|
)
|
|
|
|
ENGINE = MergeTree
|
|
|
|
ORDER BY key;
|
|
|
|
|
|
|
|
INSERT INTO table_with_pk SELECT number, toString(number % 10) FROM numbers(10000000);
|
|
|
|
|
|
|
|
ALTER TABLE table_with_pk DELETE WHERE key % 77 = 0 SETTINGS mutations_sync = 1;
|
|
|
|
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
|
|
|
|
|
|
-- Memory usage for all mutations must be almost constant and less than
|
|
|
|
-- read_bytes.
|
|
|
|
SELECT
|
|
|
|
DISTINCT read_bytes >= peak_memory_usage
|
|
|
|
FROM
|
2020-03-19 11:34:02 +00:00
|
|
|
system.part_log
|
2020-03-19 11:31:21 +00:00
|
|
|
WHERE event_type = 'MutatePart' AND table = 'table_with_pk' AND database = currentDatabase();
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS table_with_pk;
|