SQL Server Interview Question #196
What is Query Store?
Security, Backup, Recovery, Administration & Real-World Scenarios Senior Advanced
Detailed Explanation
Query Store records query text, execution plans, and runtime performance statistics over time. It helps identify regressions, compare plan behavior, analyze workload history, and in supported scenarios influence plan selection.
Query Store is especially useful when a query was fast previously but became slow after a plan change, deployment, statistics change, or data-growth event. It provides historical evidence that is often unavailable from the current plan cache alone.
Code Example
ALTER DATABASE SalesDb
SET QUERY_STORE = ON;