What does VACUUM do to a Delta table?
Why B is the answer
It removes old files that the table no longer references
It frees storage. Going too far limits time travel, so mind the retention period.
In detail
- VACUUM removes files that the table no longer references.
- Files removed by VACUUM are gone for time travel.
Use case
An illustrative scenario, not a real incident.
A table's storage grows, because old files remain after rewrites. VACUUM removes files past the retention period.
See it in different ways
flowchart LR A["Many small files"] --> B["OPTIMIZE compacts them"] B --> C["VACUUM removes unreferenced files"] C --> D["Faster reads"]
stateDiagram-v2 [*] --> SmallFiles: many small writes SmallFiles --> Compact: OPTIMIZE Compact --> Sorted: V-Order or Z-Order Sorted --> Cleaned: VACUUM removes unreferenced files Cleaned --> SmallFiles: more writes
stateDiagram-v2 state "Current file" as s0 state "Unreferenced file" as s1 state "Removed" as s2 [*] --> s0 s0 --> s1: table rewritten s1 --> s2: past retention s2 --> [*]
Key point: VACUUM removes unreferenced files.
Why the other options are wrong
- A. It copies the table into a warehouse
- It does not copy tables.
- C. It rewrites all of the rows in sorted order
- That describes sorting.
- D. It adds a new column for each partition
- It does not add columns.

