How the two retention properties and VACUUM decide which table versions you can still query or restore.
From Ultra Transcenders DP-750 by Tony Rough (coming November 2026)
Every write to a Delta (or Iceberg) table creates a new table version. Two table properties decide how long you can see the history and how long you can actually query old versions, and they are the main tools for a retention policy.
DESCRIBE HISTORY returns each operation, user and timestamp in reverse order; Catalog Explorer shows the same on the History tab.
DESCRIBE HISTORY main.sales.orders;
DESCRIBE HISTORY main.sales.orders LIMIT 1; -- last operation onlyTime travel queries an earlier version by number or timestamp:
SELECT * FROM main.sales.orders VERSION AS OF 123;
SELECT * FROM main.sales.orders TIMESTAMP AS OF '2026-09-30';
SELECT * FROM main.sales.orders@v123;
RESTORE TABLE main.sales.orders TO VERSION AS OF 120;In Python use spark.read.option("versionAsOf", 123).table(...) or timestampAsOf. The version or timestamp can’t be a subquery. RESTORE needs MODIFY. It is itself a data-changing operation, so downstream streaming readers may reprocess the restored files as new data.
To time travel you need both the log entry and the data files for that version:
| Table property | Default | Controls | Removed by |
|---|---|---|---|
delta.logRetentionDuration |
interval 30 days |
How long table history (the transaction log) is kept | Automatic clean-up after checkpoints; not VACUUM |
delta.deletedFileRetentionDuration |
interval 7 days |
How old unreferenced data files must be before VACUUM can delete them |
VACUUM |
Iceberg tables use the same property names with the iceberg. prefix. Figure 4.1 shows how the two defaults combine.
Rules in current runtimes:
deletedFileRetentionDuration. For Unity Catalog managed tables this applies on Runtime 12.2 and above.logRetentionDuration must be greater than or equal to deletedFileRetentionDuration. For Unity Catalog managed tables this also applies on Runtime 12.2 and above.ALTER TABLE main.sales.orders SET TBLPROPERTIES (
'delta.deletedFileRetentionDuration' = 'interval 30 days',
'delta.logRetentionDuration' = 'interval 30 days');Longer retention means more data files kept and higher storage costs. Databricks says table history is not a long-term backup or archive: use only the last 7 days for time travel unless both properties are raised. For a long-term copy, Learn’s clone examples create an archive table with CREATE OR REPLACE TABLE ... CLONE and long retention properties. Changing a table property conflicts with concurrent writes, so change it when nothing else is writing.
Common trap: Raising only
delta.logRetentionDurationto keep 90 days of time travel -VACUUMstill deletes data files afterdeletedFileRetentionDuration(7 days by default), and Runtime 18.0+ blocks older time travel; raise both properties.
Common trap: Treating
RESTOREas invisible to downstream jobs - it writes new log entries with data changes, so a streaming reader of the table can process the restored rows again as duplicates.
This note is one section of Ultra Transcenders DP-750: Implementing Data Engineering Solutions Using Azure Databricks, an independent study guide that explains every topic the exam covers by technology, with comparison tables, diagrams and the common traps, plus a glossary linked to Microsoft Learn.
Due on Amazon in November 2026, in Kindle and paperback editions.
About the book · DP-750 terms in the glossary · All DP-750 study notes
What standard (formerly shared) and dedicated (formerly single user) access modes allow, and when each is required.
Who manages the files, what DROP TABLE does to each, and why Databricks recommends managed tables.
How SQL UDF row filters and column masks restrict data per user, and how they differ from dynamic views.
SCD types 0, 1, 2 and others compared, and when to keep history in a dimension table.
The table-size thresholds for partitioning, partition sizing, and why liquid clustering is usually the better choice.
How expectations validate records in Lakeflow Spark Declarative Pipelines and what each violation action does.
Job and task notifications, system destinations, duration warnings and how retries affect which alerts are sent.