Reviewed by Aditya Kumar · Last reviewed 2026-03-24
**What**: Delta OPTIMIZE table ZORDER BY (cols)—physically clusters data. Space-filling curve (Z-order) for multi-column. Rows with similar values colocated. **Why**: Query WHERE date='X' scans fewer files. Combine partition by date + Z-order by user_id. Trade-off: write cost;...
What: Delta OPTIMIZE table ZORDER BY (cols)—physically clusters data. Space-filling curve (Z-order) for multi-column. Rows with similar values colocated.
Why: Query WHERE date='X' scans fewer files. Combine partition by date + Z-order by user_id. Trade-off: write cost; run OPTIMIZE periodically. Z-order high-cardinality filter columns.
Pro-Move: 'Z-order on (user_id, event_type). Queries 3x faster. OPTIMIZE weekly; cost acceptable for our read pattern.'
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.