Delta table maintenance: OPTIMIZE vs VACUUM vs V-Order vs Optimized Write

Verdict: OPTIMIZE compacts existing small files; Optimized Write prevents them on write; VACUUM only deletes unreferenced files and too-short retention breaks readers; V-Order is a write-time read optimisation, disable it on write-heavy rarely-read tables.

CriterionOPTIMIZEVACUUMV-OrderOptimized Write
What it doesCompacts many small files into fewer larger filesDeletes files no longer referenced by the Delta logWrites files in a sorted layout for faster readsMerges or splits partitions before writing to avoid small files
When to runAfter frequent small or incremental writes slow readsTo reclaim storage from obsolete filesOn tables read far more than writtenOn high-frequency streaming ingestion
Main riskNone; safe in-place compactionRetention below 7 days breaks concurrent reads and time travelAbout 15% extra write time; wrong on write-heavy rarely-read tablesNone; automatic sizing
Applies toDelta tables only, not legacy Hive Parquet/ORC/CSVDelta tables; disable retentionDurationCheck to go under 7 daysWarehouses on by default; newer workspaces have it offEnable via spark.databricks.delta.optimizeWrite.enabled

Rules

Traps