QuestionQ64

VerifiedSecure, optimize, and deploy database solutions

You have an Azure SQL database named SalesDB that supports an ecommerce application. SalesDB contains a table named dbo.Orders with a clustered index on the OrderId column.

The dbo.Orders table receives continuous OLTP inserts and updates during business hours.

The analytics team runs hourly aggregate queries that scan dbo.Orders to calculate revenue trends for recent dates.

Improve hourly analytics-query performance without significantly affecting OLTP throughput. The solution must:

  • Support near-real-time (NRT) analytics on dbo.Orders.
  • Reduce read time when retrieving analytical data from dbo.Orders.
  • Support indexing only rows that satisfy a predicate, such as Active = 1.

Which index type should be used for each requirement? Each index type may be used once, more than once, or not at all.

Drag & Drop
Support NRT analytics on dbo.Orders:
Reduce read time when retrieving analytical data:
Index only rows that match a predicate:
Explanation

A nonclustered columnstore index is designed for analytics on an existing rowstore table: it supports operational/near-real-time analytics without replacing the clustered rowstore index used for OLTP, and its compressed columnar layout improves scan and aggregation performance. A filtered nonclustered index is defined with a WHERE clause, so it indexes only rows that meet the predicate, such as Active = 1.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!