Performs a lightweight vacuum using only the transaction log, without scanning storage.
VACUUM LITE <table> [RETAIN <n> HOURS] [DRY RUN]
## Overview VACUUM LITE is a faster variant of VACUUM that relies exclusively on the Delta transaction log to identify files eligible for deletion. Unlike the standard VACUUM, it does not perform a storage-level directory listing. This makes it significantly faster for very large tables with millions of data files. ## How It Works 1. **Log scan only**: Reads the Delta transaction log to find RemoveFile actions whose deletion timestamp exceeds the retention threshold. 2. **Deletion**: Physically deletes those files from storage. 3. **No orphan detection**: Files that exist on storage but are not tracked in the transaction log (orphans from failed writes) are not detected or removed. Because VACUUM LITE skips the storage scan phase, it completes in time proportional to the number of log entries rather than the number of files on disk. ## When to Use - Tables with millions of files where a full storage listing is prohibitively slow. - Environments where orphaned files are unlikely (for example, when object storage provides strong write consistency). - As a complement to periodic full VACUUM runs. Run VACUUM LITE frequently (daily) and full VACUUM less often (weekly). ## Result Set Returns a result set with three rows: | metric | value | |--------|-------| | files_deleted | Number of files removed | | bytes_freed | Total bytes reclaimed | | dry_run | 1 if DRY RUN was specified, 0 otherwise | ## Access Control | Privilege | Object | Notes | |-----------|--------|-------| | Ownership or write | Table | Required to delete files from the table's storage. | ## Compatibility VACUUM LITE is a DeltaForge extension. The LITE mode concept corresponds to the log-only vacuum introduced in Delta Lake 3.2.0.
| Name | Type | Description |
|---|---|---|
table | Specifies the name or path of the Delta table to vacuum. The table must be registered in the session. Fully qualified names are supported. | |
retention_hours | Retention period in hours. | |
dry_run | If true, only lists files that would be deleted. |
-- Lightweight vacuum with default retention
VACUUM LITE orders;
-- Preview what would be deleted
VACUUM LITE orders DRY RUN;
-- Custom retention of 72 hours
VACUUM LITE orders RETAIN 72 HOURS;
-- Vacuum a fully qualified table
VACUUM LITE warehouse.sales.transactions RETAIN 48 HOURS;