Query Store: Memory of Plans, Memory of Mistakes
Query Store is SQL Server’s long-term memory: it records plans, decisions, and sometimes mistakes. By retaining query execution history, it allows DBAs to track how performance evolves and learn from regressions. Think of it as a diary of previous days, sometimes full of insights, sometimes regrets.
🧠 How Query Store works
Queries processed by SQL Server may be captured in Query Store, together with execution plans and runtime statistics. Over time, the engine accumulates evidence about which plans performed well and which caused regressions.
You might call Query Store SQL Server’s “black box”: it records evidence of optimizer decisions over time.
⚙️ Enabling Query Store
| |
🔍 Look into the views
| |
🧩 Plan regression
| |
🧹 Clearing Query Store
| |
A DBA who deletes history loses an opportunity to learn.
💬 Reflection
Query Store is more than a technical feature. It is a metaphor for learning from mistakes, both for SQL Server and for those of us who administer it.
“Those who cannot remember the past are condemned to repeat it.” — George Santayana
✅ Checklist
📂 Repository: SQLManiak/QueryStore-Labs