CertLumen

Databricks Data Engineer Professional · Section 5 · 15% of the exam

Use the query profile to identify performance bottlenecks, such as data-skipping inefficiencies, join strategies, and shuffle operations.

One of the objectives of the Databricks Certified Data Engineer Professional exam, in the section “Cost & Performance Optimization”. Here is what it covers, the points to remember and a question to try.

What it covers

Know which cache speeds up repeated reads and how to benchmark around it, use Change Data Feed to push only changed rows (including updates and deletes) downstream, and read the query profile to spot data-skipping, join-strategy and shuffle bottlenecks.

Points to remember

  • Disk cache (formerly Delta cache): automatic local SSD copies of Parquet and Delta files, invalidated automatically when files change; the answer for repeated reads, with no code.
  • The Spark cache is manual and lives in executor memory; the SQL warehouse result cache returns whole results for up to 24 hours.
  • Benchmark with SET use_cached_result = false; CACHE SELECT is ignored on SQL warehouses and DBR 14.2+.
  • Legacy CDF: delta.enableChangeDataFeed = true; changes exist only after enablement; _change_type is insert, update_preimage, update_postimage or delete.
  • Automatic CDF (DBR 19+, row tracking) needs no table property and uses the same table_changes() and readChangeFeed APIs.

Try a question

A serverless notebook joins a 2 TB fact table with a dimension that is 30 MB after filtering. The query profile shows a sort-merge join with large shuffle exchanges on both inputs, and most of the time is spent in the shuffle. Which fix is most appropriate?

  1. AAdd a BROADCAST hint on the dimension so the fact table isn't shuffled
  2. BSet spark.sql.autoBroadcastJoinThreshold to 50 MB in the notebook session before running the query
  3. CRaise spark.sql.shuffle.partitions to 2000
  4. DZ-order the fact table by the join key so that the sort-merge join reads less data
Show the answer

A. Shuffles on both sides of a join with a small input mean the planner picked a shuffle-based join. A broadcast hash join ships the small side to every executor and removes the large side's shuffle. Serverless compute accepts only a few Spark properties (for example spark.sql.shuffle.partitions), so a join hint is the practical lever.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Caching, Change Data Feed and the Query Profile teaches this objective (about 55 minutes), and 21 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 45 objectives · Next objective →