2024-01-13 20:09:10 +00:00
|
|
|
-- Tags: no-ordinary-database
|
|
|
|
|
2023-12-01 17:45:23 +00:00
|
|
|
create or replace table t_temp (
|
|
|
|
a UInt32,
|
|
|
|
timestamp DateTime
|
|
|
|
)
|
|
|
|
engine = MergeTree
|
|
|
|
order by a
|
2023-12-05 14:20:07 +00:00
|
|
|
TTL timestamp + INTERVAL 2 SECOND WHERE a in (select number from system.numbers limit 100_000);
|
2023-12-01 17:45:23 +00:00
|
|
|
|
|
|
|
select sleep(1);
|
|
|
|
insert into t_temp select rand(), now() from system.numbers limit 1_000_000;
|
|
|
|
select sleep(1);
|
|
|
|
insert into t_temp select rand(), now() from system.numbers limit 1_000_000;
|
|
|
|
select sleep(1);
|
|
|
|
optimize table t_temp final;
|
2024-01-13 20:09:10 +00:00
|
|
|
|
|
|
|
DROP TABLE t_temp;
|