At a glance
| Supported databases | SQL Server 2016+, Azure SQL Database and Managed Instance, Synapse dedicated pools, Fabric SQL database |
| Query analysis | Top queries by duration, CPU, IO, memory and more, over time |
| Execution plans | Multiple stored plans per query, plan comparison and forcing |
| Wait statistics | Per query, by wait category (SQL Server 2017+) |
| Index recommendations | Not part of Query Store (Azure SQL automatic tuning and missing-index DMVs are separate) |
| Slow-query detection | Regressed Queries report; no built-in alerting |
| Tuning automation | Manual plan forcing and hints; automatic plan correction is a separate automatic tuning feature (Enterprise in SQL Server 2025) |
| Default state | On for new databases from SQL Server 2022 and in Azure SQL; off on 2016-2019 |
| Licensing | Included in all SQL Server 2025 editions, including free Express |
Turn Query Store on everywhere before buying anything else. It is built in, on by default for new databases from SQL Server 2022 and in Azure SQL, and answers the most common performance question: which query got slower, and did its plan change. It is per database and has no alert routing or estate view, which is where commercial monitors earn their place.
Overview
Query Store, introduced in SQL Server 2016, keeps a per-database history of queries, their execution plans and runtime statistics, aggregated into time windows and written asynchronously. From SQL Server 2017 and in Azure SQL Database it also stores wait statistics per query, grouped into wait categories. Because it keeps several plans per query, you can force a known good plan when a plan change causes a regression, without touching application code.
Microsoft states it is on by default in READ_WRITE mode for new databases from SQL Server 2022 and for new Azure SQL Database and Managed Instance databases, but not on SQL Server 2016, 2017 or 2019 or new Azure Synapse databases, and it cannot be enabled for master or tempdb. SQL Server 2022 added Query Store hints, which inject query hints by query_id through sys.sp_query_store_set_hints, and SQL Server 2025 adds Query Store for secondary replicas, so readable secondaries report into the primary's store.
Key features
- Per-database history of query text, plans and runtime statistics (duration, CPU, reads, writes, memory, tempdb) in time windows
- Per-query wait statistics by wait category (SQL Server 2017 and later, Azure SQL)
- Plan forcing and unforcing from SSMS reports or sp_query_store_force_plan
- Query Store hints (SQL Server 2022 and later, Azure SQL, Fabric): apply hints such as RECOMPILE or MAXDOP by query_id without changing code
- SSMS reports including Regressed Queries and Query Wait Statistics
- Catalog views such as sys.query_store_query, sys.query_store_plan and sys.query_store_runtime_stats for your own queries
- Query Store for secondary replicas (SQL Server 2025 Enterprise, Azure SQL Database)
Integrations and ecosystem
Pros and cons
Pros
- No extra cost, and available even in SQL Server Express
- On by default for new databases from SQL Server 2022 and in Azure SQL
- Plan forcing and Query Store hints fix regressions without code changes
- Data survives restarts, unlike the plan cache
- Every major SQL Server monitoring tool can read it
Cons
- Per database: no estate-wide dashboard, alert routing or notification
- Needs configuration of size and capture settings to avoid filling up on busy databases
- Not enabled by default on SQL Server 2016, 2017 or 2019
- Secondary replica support and automatic tuning are Enterprise only in SQL Server 2025
Pricing
Query Store ships with the database engine and has no charge of its own. In SQL Server 2025, Microsoft lists Query Store, on-by-default for new databases and Query Store hints in Enterprise, Standard and the free Express edition, so it can be used at no cost; production use of Standard or Enterprise needs a SQL Server licence, and in Azure it is part of the Azure SQL service you pay for. Two related features are edition-limited in SQL Server 2025: Query Store on secondary replicas and automatic tuning are Enterprise only.
Pricing checked on the vendor's official page on 7 November 2026. Prices change; confirm before buying.
Who it is best for
Every SQL Server and Azure SQL database as the baseline for query performance history, plan regression fixes and hint injection.
Typical use cases
- Finding and fixing a plan regression after an upgrade or statistics change by forcing the previous plan
- Listing the top queries by CPU or duration over the last day
- Applying a RECOMPILE or MAXDOP hint to a vendor application query you cannot edit
- Comparing query performance before and after a compatibility level change
Who should look elsewhere
- Teams that need alerts and a single view across many servers: see SQL Server monitoring tools.
Verdict
Query Store is the free foundation of SQL Server performance work: history, plans, waits and the ability to fix regressions without code changes. Enable and size it on every database, and add a commercial monitor only when you need alerting, estate views or longer cross-server history.
Frequently asked questions
Is Query Store enabled by default?
For new databases from SQL Server 2022 (16.x), yes, in READ_WRITE mode, and for new Azure SQL Database and Managed Instance databases. It is not on by default on SQL Server 2016, 2017 or 2019, or for new Azure Synapse databases.
Does Query Store cost extra?
No. It is part of the database engine, and Microsoft lists it in SQL Server 2025 Enterprise, Standard and the free Express edition. Query Store on secondary replicas is Enterprise only.
What are Query Store hints?
A SQL Server 2022 and Azure SQL feature that attaches query hints, such as RECOMPILE, MAXDOP or a compatibility level, to a query by its Query Store query_id using sys.sp_query_store_set_hints. Hints persist across restarts and failovers and override plan guides.
Does Query Store recommend indexes?
No. It records history and lets you force plans or apply hints. Index suggestions come from other features such as missing-index DMVs or automatic tuning in Azure SQL Database.
Sources
- Monitor performance by using the Query Store (Microsoft Learn)
- Query Store hints (Microsoft Learn)
- Query Store for secondary replicas (Microsoft Learn)
- Editions and supported features of SQL Server 2025 (Microsoft Learn)
- Best practices for managing the Query Store (Microsoft Learn)
Checked November 2026.
Listed in: Performance & Query Optimization.
How we research reviews and what star ratings mean: our editorial method.