Databricks Data Engineer Professional · Section 5 · 15% of the exam
Understand how caching (Delta cache) improves query performance for repeated reads of the same data.
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 SELECTis ignored on SQL warehouses and DBR 14.2+. - Legacy CDF:
delta.enableChangeDataFeed = true; changes exist only after enablement;_change_typeis insert, update_preimage, update_postimage or delete. - Automatic CDF (DBR 19+, row tracking) needs no table property and uses the same
table_changes()andreadChangeFeedAPIs.
Try a question
A new streaming job reads workspace.crm.customers with readChangeFeed to apply changes to a downstream table. Change data feed was enabled on the table long ago. On its first run, the job processed millions of insert rows, one per existing customer, before any real changes. Why, and how could it have read only the changes after version 950?
- AWithout a start version the stream first emits a snapshot as inserts; set
startingVersionto 951 - BChange data feed replays all history from version 0; filter
_commit_version > 950inside the stream - CThe checkpoint was missing; reuse the checkpoint of another query that reads the same table
- D
readChangeFeedreturns preimages as inserts; drop the rows where_change_type = 'insert'
Show the answer
A. When a change data feed stream starts without startingVersion or startingTimestamp, it returns the latest snapshot of the table as insert rows and then every later change. Setting startingVersion (inclusive) on the first run reads only changes from that version on; the checkpoint then tracks progress.
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
- Explain how Unity Catalog managed tables, Predictive Optimization, and Liquid Clustering reduce operational and maintenance overhead for a given workload.
- Choose the appropriate Delta optimization technique (deletion vectors, Liquid Clustering, CLUSTER BY AUTO) for a given table access pattern.
- Apply Change Data Feed (CDF) to expose row-level changes (updates/deletes) for efficient incremental downstream processing.
- Use the query profile to identify performance bottlenecks, such as data-skipping inefficiencies, join strategies, and shuffle operations.
- Compare Liquid Clustering vs partitioning/ZORDER for a given table size and query pattern.