mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 16:52:56 +00:00
* test: adds sqlness test for TTL * chore: restart cluster * fix: typo * test: adds database TTL with metric engine tables
41 lines
714 B
SQL
41 lines
714 B
SQL
CREATE TABLE test_ttl(ts TIMESTAMP TIME INDEX, val INT, PRIMARY KEY(val)) WITH (ttl = '1 day');
|
|
|
|
INSERT INTO test_ttl VALUES
|
|
(now(), 1),
|
|
(now(), 2),
|
|
(now(), 3);
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
-- SQLNESS SLEEP 2s
|
|
ADMIN flush_table('test_ttl');
|
|
|
|
ADMIN compact_table('test_ttl');
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
ALTER TABLE test_ttl SET ttl = '1 second';
|
|
|
|
-- SQLNESS SLEEP 2s
|
|
ADMIN compact_table('test_ttl');
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
ALTER TABLE test_ttl SET ttl = '1 minute';
|
|
|
|
INSERT INTO test_ttl VALUES
|
|
(now(), 1),
|
|
(now(), 2),
|
|
(now(), 3);
|
|
|
|
-- SQLNESS SLEEP 2s
|
|
ADMIN flush_table('test_ttl');
|
|
|
|
ADMIN compact_table('test_ttl');
|
|
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
|
|
DROP TABLE test_ttl;
|