In order to enable query store feature in SQL Server 2016, one can use Transact-SQL:
ALTER DATABASE AdventureWorks2012 SET QUERY_STORE = ON;
The query store feature in SQL Server 2016 can also be enabled through SQL Server Management Studio, by choosing the database properties/query store page.
Quoting from Microsoft MSDN Page: I am listing a couple of scenarios for using query store feature:
- Quickly find and fix a plan performance regression by forcing the previous query plan. Fix queries that have recently regressed in performance due to execution plan changes.
- Determine the number of times a query was executed in a given time window, assisting a DBA in troubleshooting performance resource problems.
The MSDN link for Query Store is listed below: The page below provides a more completion explanation of query store.