OPTIMIZE consolidates the small Parquet files of a Delta table

DP-700 By islever Editorial Last updated

Short answer

C OPTIMIZE consolidates Table1's small Parquet files into larger ones, while VACUUM only removes unreferenced files.

Question

You have a Fabric workspace that contains a lakehouse and a notebook named Notebook1. Notebook1 reads data into a DataFrame from a table named Table1 and applies transformation logic. The data from the DataFrame is then written to a new Delta table named Table2 by using a merge operation. You need to consolidate the underlying Parquet files in Table1. Which command should you run?
  1. VACUUM
  2. BROADCAST
  3. OPTIMIZE Correct Answer
  4. CACHE

Key Takeaways

OPTIMIZE is the Delta Lake maintenance command that consolidates small Parquet files into larger ones (ideally 128 MB to 1 GB); VACUUM deletes unreferenced files and never compacts anything.

Running OPTIMIZE on Table1 compacts its many small Parquet files into larger ones, solving the small-file problem; VACUUM only removes files no longer referenced by the Delta log, and BROADCAST and CACHE are query-time hints, not file maintenance.

Common mistake: Confusing OPTIMIZE with VACUUM: VACUUM cleans up old and unreferenced files, while only OPTIMIZE rewrites and consolidates the underlying Parquet files.

Expert Analysis

Why the Answer Is Correct

In Delta Lake, the OPTIMIZE command rewrites a table to consolidate many small Parquet files into fewer larger ones, improving read performance across all Fabric engines. Notebook1's merge writes into Table2, while Table1 needs file compaction, and OPTIMIZE is exactly the command for consolidating Table1's underlying Parquet files.

Why the Other Options Are Wrong

Option A (VACUUM) removes files no longer referenced by the Delta table log; it does not consolidate anything. Option B (BROADCAST) is a join hint that replicates a small table to all executors. Option D (CACHE) materializes data in memory for faster queries; neither touches the on-disk file layout.

Community Comment Notes

The community is unanimous (C 100). GHill1982 (4 likes) states OPTIMIZE consolidates the underlying Parquet files, henryphchan and prabhjot explain the small-file problem, and Tuki93 notes file sizes above 128 MB and optimally near 1 GB improve compression and scan efficiency. doctordodge links the lakehouse table maintenance documentation.

Official Reference

https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-table-maintenance

This link opens the official vendor documentation in a new tab.

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 6 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 6

  1. GHill1982 👍 4 Answered C
    To consolidate the underlying Parquet files in Table1, you should run the OPTIMIZE command.
  2. henryphchan 👍 2 Answered C
    In Delta Lake, the OPTIMIZE command is used to consolidate small Parquet files into larger ones. This improves query performance by reducing the overhead of managing many small files. VACUUM command is used to clean up and remove files that are no longer needed (e.g., old versions of data files, deleted files)
  3. prabhjot 👍 2 Answered C
    Optimize solves the "small file problem" by consolidating multiple small files into larger parquet files
  4. Tuki93 👍 1 Answered C
    Optimize: Consolidates multiple small Parquet files into large file. Big Data processing engines, and all Fabric engines, benefit from having larger files sizes. Having files of size above 128 MB, and optimally close to 1 GB, improves compression and data distribution, across the cluster nodes. It reduces the need to scan numerous small files for efficient read operations. It's a general best practice to run optimization strategies after loading large tables.
  5. doctordodge 👍 1 Answered C
    Link: https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-table-maintenance
Show 1 more comment
  1. benni_ale 👍 1 Answered C
    Optimise!

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to DP-700 Study Guide