
Answer-first summary for fast verification
Answer: Run OPTIMIZE command with z-ordering on product_id, set auto-compaction to true, and use VACUUM with a retention interval of 7 days.
Using the OPTIMIZE command with z-ordering on product_id helps in clustering data more efficiently, which is beneficial for read operations. Enabling auto-compaction ensures that small files are periodically merged, improving write performance. Using VACUUM with a reasonable retention interval (7 days) helps in cleaning up unused files without risking data loss.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are tasked with optimizing a Delta table for the Databricks SQL service that contains data from a retail store. The table includes columns like transaction_id, product_id, customer_id, and timestamp. Explain how you would use Delta Lake features such as OPTIMIZE, VACUUM, and the configuration of auto-compaction to ensure the table is optimized for both read and write operations.
A
Run OPTIMIZE command with z-ordering on product_id, set auto-compaction to true, and use VACUUM with a retention interval of 7 days.
B
Run OPTIMIZE command with z-ordering on customer_id, disable auto-compaction, and use VACUUM with a retention interval of 1 day.
C
Run OPTIMIZE command with z-ordering on timestamp, set auto-compaction to true, and use VACUUM with a retention interval of 30 days.
D
Run OPTIMIZE command with z-ordering on transaction_id, disable auto-compaction, and do not use VACUUM.
No comments yet.