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 600000
, i.e. 10 minutes. To modify retention period, 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
.