ClickHouse/tests/queries/0_stateless/01282_system_parts_ttl_info.sql

10 lines
710 B
MySQL
Raw Normal View History

2020-05-21 09:55:39 +00:00
DROP TABLE IF EXISTS ttl;
CREATE TABLE ttl (d DateTime) ENGINE = MergeTree ORDER BY tuple() TTL d + INTERVAL 10 DAY;
2020-07-15 11:47:51 +00:00
SYSTEM STOP MERGES ttl;
2020-05-21 09:55:39 +00:00
INSERT INTO ttl VALUES ('2000-01-01 01:02:03'), ('2000-02-03 04:05:06');
SELECT rows, delete_ttl_info_min, delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl';
2020-07-15 11:47:51 +00:00
SYSTEM START MERGES ttl;
2020-05-21 09:55:39 +00:00
OPTIMIZE TABLE ttl FINAL;
2020-07-13 02:26:22 +00:00
SELECT rows, toTimeZone(delete_ttl_info_min, 'UTC'), toTimeZone(delete_ttl_info_max, 'UTC'), move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl' AND active;
2020-05-21 09:55:39 +00:00
DROP TABLE ttl;