Does running OPTIMIZE on a delta table destroy the transaction history of table?

cgrant
Databricks Employee
Databricks Employee

If I run OPTIMIZE on a Delta Lake table, will it prevent me from time travelling to a version before OPTIMIZE was run?

cgrant
Databricks Employee
Databricks Employee

No, you will still be able to time travel to versions previous to the OPTIMIZE command.

OPTIMIZE is just another transaction like MERGE, UPDATE, etc.

Check out these docs to learn more about retention periods and the VACUUM command.