This guide describes how to leverage the time travel feature. This feature helps access historical data at a specific time.
time_travel_retention_ms
controls time travel functionality. By default, it’s set to 0
, which means time travel is turned off. To enable time travel, you need to alter this system parameter to a non-zero value.
For example, you can set time_travel_retention_ms
to 86400000
(1 day). Then historical data older than this period will be deleted and no longer accessible.
FOR SYSTEM_TIME AS OF
separately for each table accessing historical data. The following subclauses can be used:
SELECT * FROM t_foo FOR SYSTEM_TIME AS OF 1721024455;
.SELECT * FROM t_foo FOR SYSTEM_TIME AS OF '2000-02-29T12:13:14-08:30';
.SELECT * FROM t_foo FOR SYSTEM_TIME AS OF NOW() - '10' SECOND;
.time travel: version not found for epoch
.vacuum_interval_sec
setting. After changing this setting, restart the meta node for it to take effect.full_gc_interval_sec
and min_sst_retention_time_sec
. After modifying these values, restart the meta node to apply the changes.