2019-05-31 04:03:46 +00:00
|
|
|
DROP TABLE IF EXISTS part_info;
|
|
|
|
CREATE TABLE part_info (t DateTime) ENGINE = MergeTree PARTITION BY toDate(t) ORDER BY (t);
|
|
|
|
INSERT INTO part_info VALUES (toDateTime('1970-10-01 00:00:01')), (toDateTime('1970-10-02 00:00:01')), (toDateTime('1970-10-03 00:00:01'));
|
|
|
|
SELECT name, is_frozen FROM system.parts WHERE `database` = currentDatabase() AND `table` = 'part_info';
|
|
|
|
SELECT 'freeze one';
|
2020-01-26 18:53:24 +00:00
|
|
|
ALTER TABLE part_info FREEZE PARTITION '1970-10-02';
|
2019-05-31 04:03:46 +00:00
|
|
|
SELECT name, is_frozen FROM system.parts WHERE `database` = currentDatabase() AND `table` = 'part_info';
|
|
|
|
SELECT 'freeze all';
|
|
|
|
ALTER TABLE part_info FREEZE;
|
|
|
|
SELECT name, is_frozen FROM system.parts WHERE `database` = currentDatabase() AND `table` = 'part_info';
|
|
|
|
INSERT INTO part_info VALUES (toDateTime('1970-10-02 00:00:02'));
|
|
|
|
select * from part_info order by t;
|
|
|
|
SELECT name, is_frozen FROM system.parts WHERE `database` = currentDatabase() AND `table` = 'part_info';
|
|
|
|
DROP TABLE part_info;
|