Is the blanket claim “Nonclustered indexes are faster than clustered indexes for data retrieval” valid for SQL Server, or does performance depend on workload and query patterns?

Difficulty: Easy

Correct Answer: Incorrect — performance depends on access patterns and design

Explanation:


Introduction / Context:
Index selection in SQL Server is workload-dependent. Clustered and nonclustered indexes offer different benefits. Absolutes like “nonclustered is faster” are misleading and can lead to suboptimal designs.


Given Data / Assumptions:

  • A table can have one clustered index that defines the physical order of rows.
  • Nonclustered indexes store keys plus row locators (RID or clustering key).
  • Queries vary: point lookups, range scans, covering reads, aggregations.


Concept / Approach:
Clustered indexes excel at range queries on the clustering key and can reduce lookups when the clustering key participates in predicates and joins. Nonclustered indexes can be faster for selective point lookups, especially when they are covering (include all needed columns). Neither is universally “faster.” Proper design considers selectivity, covering, write overhead, and fragmentation.


Step-by-Step Solution:
Evaluate workload: predicates, joins, order by, group by.Choose a clustering key that supports common range/group operations.Add nonclustered indexes to cover selective queries (INCLUDE columns as needed).Validate with execution plans and wait statistics.


Verification / Alternative check:
Compare logical reads with SET STATISTICS IO ON and observe plans using the clustered index vs. a covering nonclustered index.


Why Other Options Are Wrong:
“Always faster” is false; range scans are often better on clustered indexes; heaps change lookup mechanics but do not make NCI universally faster; MAXDOP is irrelevant to this absolute claim.


Common Pitfalls:
Over-indexing; ignoring INCLUDE columns; poor clustering key selection causing excessive key lookups.


Final Answer:
Incorrect — performance depends on access patterns and design

More Questions from SQL Server 2000

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion