Skip to content
BENIBIX Learn

Time Travel Query

Also known as Time Travel, Table Versioning

Reading a table as it was at an earlier time. Mistakes can be undone.

Think of it like

It is like undo in a drawing app. You can see the picture as it was an hour ago.

Example

A bad job deletes half the orders table at 3pm. At 3:10pm, the team reads the 2pm version and puts it back.

Why it matters

Mistakes in data are common. Time travel turns a lost day into a ten-minute fix.

Definition

Time travel lets you query a table as it was at an earlier time or version. Each change keeps the old data for a while instead of wiping it. A query names a version number or a timestamp. It is used to undo mistakes, check old reports and repeat old results. Old versions are kept only for a set number of days.

Example code

sql
SELECT COUNT(*) FROM orders VERSION AS OF 12;
SELECT COUNT(*) FROM orders TIMESTAMP AS OF '2026-11-15';
Count the orders as they were at version 12, and at the start of a past day.

Common mistake

Treating it as a backup. Old versions are cleaned out after a set time, and then they are gone.

Key takeaways

  1. 1
    Past versions. Each change keeps the old one for a while.
  2. 2
    Query by time. Name a version or a timestamp.
  3. 3
    Not forever. Old versions expire after a set time.