Subdomain 1.1: Design and implement database objects
1.A data engineering team stores 900 million sales transaction rows in Azure SQL Database. Nightly reports run SUM() and AVG() aggregations that scan most of the table with very few single-row lookups. Which index should the team create on this fact table to best support the workload?
- A.Create nonclustered rowstore indexes on every foreign key column
- B.Create a clustered columnstore index on the fact table
- C.Create a unique constraint on the transaction ID column
- D.Create a clustered rowstore index on the transaction date column
Show answer & explanation
Correct answer: B — Create a clustered columnstore index on the fact table
- A. Nonclustered rowstore indexes speed up seeks for small numbers of rows, but they do not help a workload dominated by large aggregations across most of the table, and maintaining many of them adds write overhead.
- B. Column-by-column storage with segment elimination and batch-mode execution is built for exactly this kind of large-scale scan and aggregation workload, and it delivers far higher compression than rowstore.
- C. A uniqueness constraint enforces data integrity on one column but provides no benefit for scan-heavy aggregation queries across billions of rows.
- D. A clustered rowstore index physically orders rows by date, which helps range filtering but still requires row-by-row processing for the wide aggregations described here.