🗄️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
Example code
sql
SELECT COUNT(*) FROM orders VERSION AS OF 12;
SELECT COUNT(*) FROM orders TIMESTAMP AS OF '2026-11-15';Common mistake
Key takeaways
- 1Past versions. Each change keeps the old one for a while.
- 2Query by time. Name a version or a timestamp.
- 3Not forever. Old versions expire after a set time.