What is Query Store in SQL Server, and what information does it automatically capture?
Short answer
Query Store is a built-in feature that automatically captures a history of queries, their execution plans, and detailed runtime statistics like duration and resource usage over time, giving you a persistent record you can analyze later without needing to have already been…
Advertisement
AModel answer
Query Store is a built-in feature that automatically captures a history of queries, their execution plans, and detailed runtime statistics like duration and resource usage over time, giving you a persistent record you can analyze later without needing to have already been actively monitoring the server when a performance problem occurred.
ALTER DATABASE MyDatabase SET QUERY_STORE = ON;Real-world example
A database administrator enables Query Store on a critical production database, immediately gaining visibility into query performance history that will be invaluable the next time a performance issue needs to be investigated.
Likely follow-ups
- Is Query Store enabled by default on new databases?
- How much overhead does enabling Query Store typically add to a system?
Related topics