Skip to content

DP-600 · Domain 2: Prepare and serve data · 42% of the exam

Task 2.4: Optimize performance

Finding and fixing data loading bottlenecks in dataflows, notebooks and SQL queries, and resolving Delta table file size issues.

Study it

  • Data loading bottlenecks in dataflows, notebooks and SQL queries

    Partly covered by: Reading a Query Plan

  • Delta table file sizes, V-Order and table maintenance

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.

Question 1 · choose 1

A notebook loads each day's new orders into FactOrders by writing the whole table with mode("overwrite"), the new rows included. After each nightly framing, the first report queries on the Direct Lake model are slow for a long time, as if the model were loaded from scratch. Existing rows never change. What should you change in the load?

  1. ARun OPTIMIZE on FactOrders after each overwrite
  2. BWrite only the new rows with mode("append")
  3. CRun VACUUM on FactOrders after each overwrite
  4. DTurn off Keep your Direct Lake data up to date on the model
Show the answer and why
  • ARun OPTIMIZE on FactOrders after each overwrite

    Incorrect

    OPTIMIZE rewrites files as well, so it adds another reload instead of avoiding one.

  • BWrite only the new rows with mode("append")

    Correct

    Appending adds Parquet files without touching existing ones, so incremental framing keeps the loaded column segments.

  • CRun VACUUM on FactOrders after each overwrite

    Incorrect

    VACUUM removes unreferenced old files; it doesn't stop the overwrite from replacing the current ones.

  • DTurn off Keep your Direct Lake data up to date on the model

    Incorrect

    That only changes when framing happens; the next framing would still reload everything after an overwrite.

Direct Lake avoids full cold-state reloads through incremental framing, reusing in-memory data that is still valid. Using the Overwrite option on an existing table erases the Delta log, so Direct Lake can't frame incrementally and must reload all data, dictionaries and join indexes. Incremental loading, which only inserts new data without affecting existing Parquet files and row groups, works well with incremental framing.

Question 2 · choose 1

To save storage, a maintenance notebook now runs VACUUM on the gold tables every hour with a 1-hour retention, with the retention safety check turned off. The Direct Lake model on those tables has automatic updates turned off and is refreshed by the pipeline once a day at 06:00, and the business wants its data to change only at that refresh. Since the change, reports fail during the day with errors about missing files. What should you do?

  1. ARun OPTIMIZE before each VACUUM so that fewer files are removed
  2. BTurn on Keep your Direct Lake data up to date and keep the hourly 1-hour VACUUM
  3. CKeep a retention longer than the time between framings, like the default one
  4. DRun the same VACUUM from the lakehouse Maintenance option instead of a notebook
Show the answer and why
  • ARun OPTIMIZE before each VACUUM so that fewer files are removed

    Incorrect

    Compaction replaces files with new ones; the old files that the framed version still reads would then be vacuumed.

  • BTurn on Keep your Direct Lake data up to date and keep the hourly 1-hour VACUUM

    Incorrect

    Automatic updates would reframe whenever the tables change, so the data would no longer change only at 06:00.

  • CKeep a retention longer than the time between framings, like the default one

    Correct

    A framed model reads the Delta version of its last framing, so files of that version must outlive the gap until the next refresh.

  • DRun the same VACUUM from the lakehouse Maintenance option instead of a notebook

    Incorrect

    Where VACUUM runs doesn't matter; a 1-hour retention still removes files that the framed version needs.

Vacuuming removes Parquet files that aren't in the current Delta commit version and are older than the retention threshold. Because a framed Direct Lake model references a particular commit version, the table must keep that version until the model is framed again; otherwise queries fail when the model tries to read Parquet files that no longer exist.

Question 3 · choose 1

A 600 GB lakehouse table was written years ago by a job that forced 10 GB Parquet files. Runtime 2.0 notebooks and the SQL analytics endpoint now scan it slowly with only a few parallel readers, and DESCRIBE DETAIL shows 60 files. Adaptive target file size is on with its defaults. What should you do?

  1. ARun OPTIMIZE on the table to rebalance its file sizes
  2. BRewrite it with CREATE OR REPLACE TABLE AS SELECT
  3. CRun VACUUM on the table with the default retention
  4. DEnable auto compaction on the table for future writes
Show the answer and why
  • ARun OPTIMIZE on the table to rebalance its file sizes

    Incorrect

    OPTIMIZE compacts small files into bigger ones; it doesn't split files that are already far above the target.

  • BRewrite it with CREATE OR REPLACE TABLE AS SELECT

    Correct

    Rewriting with adaptive target file size on produces files sized for the table, which restores scan parallelism.

  • CRun VACUUM on the table with the default retention

    Incorrect

    VACUUM deletes unreferenced files; it doesn't change the files of the current version.

  • DEnable auto compaction on the table for future writes

    Incorrect

    Auto compaction runs when there are too many small files, which isn't this table's problem.

The SQL analytics endpoint and Spark parallelize scans at the Parquet file level, so too few very large files limit parallelism just as too many small files add overhead. For legacy oversized files that stay far above the current adaptive target, Fabric guidance is to rewrite the table with an overwrite or CREATE OR REPLACE TABLE AS SELECT with adaptive target file size enabled. Auto compaction and OPTIMIZE address small files, and VACUUM only reclaims storage.

Question 4 · choose 1

A Dataflow Gen2 has 12 queries: one reads a small on-premises SQL Server table through an on-premises data gateway, and eleven read large Azure SQL Database tables that are reachable from the cloud. Since the on-premises query was added, the whole refresh has become much slower, and the gateway server's network is saturated. The on-premises data must still be refreshed. What should you do?

  1. AEnable fast copy for the eleven Azure SQL queries in the same dataflow
  2. BAdd a second gateway member to the cluster and keep one dataflow
  3. CTurn off staging for the on-premises query
  4. DMove the on-premises query into a separate dataflow
Show the answer and why
  • AEnable fast copy for the eleven Azure SQL queries in the same dataflow

    Incorrect

    The queries would still move their data through the gateway, which stays the bottleneck.

  • BAdd a second gateway member to the cluster and keep one dataflow

    Incorrect

    More gateway capacity could help, but the cloud data would still travel through the on-premises gateway unnecessarily.

  • CTurn off staging for the on-premises query

    Incorrect

    Staging affects where transformations run, not which queries move their data through the gateway.

  • DMove the on-premises query into a separate dataflow

    Correct

    When one query of a dataflow uses a gateway, all its queries use that gateway, so separating it frees the cloud queries.

If at least one query of a Dataflow Gen2 is configured to use a gateway, all queries of that dataflow use the gateway for data movement. Large cloud sources then travel through the on-premises gateway as well, which can saturate it. Splitting queries that need the gateway into a separate dataflow lets the cloud queries refresh without it.

Question 5 · choose 2

A single workspace holds 60 lakehouses written by many Spark jobs. New rows often take many minutes to appear in the lakehouses' SQL analytics endpoints, while one-lakehouse test workspaces show changes in seconds. A nightly pipeline also needs one lakehouse's endpoint to be current right after its Spark job, before a stored procedure reads it. Which two actions follow Fabric guidance? (Choose TWO.)

  1. AMove lakehouses into separate workspaces so that automatic metadata discovery can scale
  2. BHave the pipeline call the Refresh SQL analytics endpoint metadata REST API after the Spark job
  3. CTurn on V-Order for all tables so that the endpoint reads them faster
  4. DCreate one more SQL analytics endpoint for each busy lakehouse
  5. ESwitch the endpoints to a case-insensitive collation
Show the answer and why
  • AMove lakehouses into separate workspaces so that automatic metadata discovery can scale

    Correct

    Metadata discovery runs as a single instance per workspace, so many lakehouses in one workspace can increase sync latency.

  • BHave the pipeline call the Refresh SQL analytics endpoint metadata REST API after the Spark job

    Correct

    An on-demand metadata sync makes the endpoint reflect the committed changes before the next step reads it.

  • CTurn on V-Order for all tables so that the endpoint reads them faster

    Incorrect

    V-Order affects read performance of the files, not how fast metadata changes are discovered and synced.

  • DCreate one more SQL analytics endpoint for each busy lakehouse

    Incorrect

    Each lakehouse has exactly one SQL analytics endpoint; you can't add more.

  • ESwitch the endpoints to a case-insensitive collation

    Incorrect

    Collation affects comparisons and sorting, not metadata sync latency.

A background process keeps each SQL analytics endpoint in sync with the changes committed to its lakehouse, normally in under a minute. Automatic metadata discovery is a single instance per Fabric workspace, so a large number of lakehouses in one workspace can increase latency; guidance is to consider moving lakehouses to separate workspaces. You can also start an on-demand sync in the portal or with the Refresh SQL analytics endpoint metadata REST API.

Question 6 · choose 1

Trickle loads into a Fabric warehouse table create many small Parquet files. What maintenance should you schedule for that table?

  1. AA nightly OPTIMIZE on the table from a Spark notebook
  2. BA weekly VACUUM with a 7-day retention
  3. CAuto compaction turned on for the table
  4. DNone, because warehouse compaction is automatic
Show the answer and why
  • AA nightly OPTIMIZE on the table from a Spark notebook

    Incorrect

    OPTIMIZE is for Spark-managed lakehouse tables; the warehouse handles its own compaction.

  • BA weekly VACUUM with a 7-day retention

    Incorrect

    VACUUM is a lakehouse maintenance task; warehouse cleanup is system-managed.

  • CAuto compaction turned on for the table

    Incorrect

    Auto compaction is a Spark feature for lakehouse tables.

  • DNone, because warehouse compaction is automatic

    Correct

    Fabric Data Warehouse manages its Delta layout and compaction itself.

Fabric Data Warehouse manages the physical Delta table layout regardless of the ingestion method: compaction, file sizes and the cleanup of unreferenced files are automatic. Spark features such as auto compaction, OPTIMIZE and VACUUM belong to lakehouse table maintenance.

Question 7 · choose 1

You're checking the layout of a Delta table that a Direct Lake model reads. Which row group size range does Direct Lake generally perform best with?

  1. ABetween 1 million and 16 million rows
  2. BBetween 1,000 and 10,000 rows
  3. CExactly one row group per Parquet file
  4. DAs small as possible, to speed up incremental framing
Show the answer and why
  • ABetween 1 million and 16 million rows

    Correct

    Direct Lake prefers large row groups in that range; much smaller ones create many small segments.

  • BBetween 1,000 and 10,000 rows

    Incorrect

    Row groups that small create many tiny column segments and slow queries.

  • CExactly one row group per Parquet file

    Incorrect

    The guidance is about rows per group, not one group per file.

  • DAs small as possible, to speed up incremental framing

    Incorrect

    Small row groups add segments and transcoding overhead.

Direct Lake generally performs best with row groups between 1 million and 16 million rows. The row group count of a Delta table maps to the column segment count of the model table, so many small row groups mean many small segments and more dictionary merging, which hurts performance. Fabric might use larger row groups for large, compressible tables.

Question 8 · choose 1

A Dataflow Gen2 refresh runs for 26 hours and is stopped. Which documented limit did it hit?

  1. AA single query evaluation can last at most 8 hours
  2. BA dataflow can refresh at most 48 times a day
  3. CA single refresh can last at most 24 hours
  4. DA refresh can last at most 5 hours on F SKUs
Show the answer and why
  • AA single query evaluation can last at most 8 hours

    Incorrect

    That limit applies to one query's evaluation, not the whole refresh.

  • BA dataflow can refresh at most 48 times a day

    Incorrect

    That's the number of scheduled slots, not a duration limit.

  • CA single refresh can last at most 24 hours

    Correct

    The total refresh time of a single dataflow refresh is limited to 24 hours.

  • DA refresh can last at most 5 hours on F SKUs

    Incorrect

    No five-hour limit is listed for Dataflow Gen2; its refresh limits don't depend on the SKU.

Dataflow Gen2 refreshes have documented limits: a single evaluation of a query can run up to 8 hours, and the total time of a single refresh is limited to 24 hours. A refresh schedule can define up to 48 time slots a day.

Question 9 · choose 1

A Dataflow Gen2 loads a lakehouse table with incremental refresh, and the table collects many small files. Which maintenance option does Fabric guidance rule out for that table?

  1. AChecking its file layout with DESCRIBE DETAIL
  2. BRunning OPTIMIZE or REORG TABLE on it
  3. CReading it from the SQL analytics endpoint
  4. DRunning VACUUM within its retention requirements
Show the answer and why
  • AChecking its file layout with DESCRIBE DETAIL

    Incorrect

    Inspecting the layout is fine; the restriction is on rewriting the table.

  • BRunning OPTIMIZE or REORG TABLE on it

    Correct

    Lakehouse destinations that use Dataflow Gen2 incremental refresh don't support OPTIMIZE or REORG TABLE.

  • CReading it from the SQL analytics endpoint

    Incorrect

    Reads are unaffected; the restriction concerns maintenance commands.

  • DRunning VACUUM within its retention requirements

    Incorrect

    VACUUM removes unreferenced files and isn't the operation the guidance excludes.

Some destination modes impose maintenance restrictions on lakehouse tables. Dataflow Gen2 lakehouse destinations that use incremental refresh don't support OPTIMIZE or REORG TABLE; follow the Dataflow Gen2 incremental refresh limitations.

Practice domain 2 →Practice all domains →