Skip to content
Back to Blog

The Small Files Problem in Iceberg, Delta Lake, and Hudi: Compaction Strategies Compared

Small files inflate query times and S3 request costs across every open table format. The symptoms look the same: slow scans, high GET counts, growing object counts. But the fix is format-specific. Here is which compaction procedure to run for each format.

Why small files hurt performance

Query engines like Athena and Spark open one task per file. A table with 50,000 files of 1 MB each requires 50,000 file open operations, task slots, and metadata fetches. The same data in 50 files of 1 GB each requires 50.

Iceberg: bin-pack compaction

Iceberg’s compaction uses the bin-pack strategy (CALL system.rewrite_data_files) to merge small files into target-size files (default 512 MB). Run this per table partition for the most control. Iceberg 1.5+ supports concurrent compaction with write operations.

Delta Lake: OPTIMIZE and ZORDER

Delta Lake’s OPTIMIZE command compacts small files into 1 GB files and optionally applies Z-ORDER co-location for frequently filtered columns. Delta 3.0+ supports Liquid Clustering as an alternative to static Z-ORDER. Run OPTIMIZE after batch writes and on a daily schedule for streaming tables.

Apache Hudi: compaction for MOR tables

Hudi MOR (Merge-on-Read) tables accumulate log files alongside base files. Compaction merges log files back into base files. Inline compaction runs during writes; async compaction runs separately. When compaction lags, the log-to-base-file ratio climbs and read amplification increases.

Start with proof,
not a pitch.

Free 14-day Data Access Review. Read-only. First findings in 48 hours.