Query store feature captures a history of queries, plans and run time statics and retains for DBA’s review.
There are number of metrics inside you can measure.
- CPU time.
- execution count.
- memory consumption.
- logical reads/writes.
- physical reads.
To enable this feature you can configure from SSMS or TSQL -Script.
To enable the feature with TSQL
ALTER DATABASE <dbname> SET QUERY_STORE = ON;
Click on Database Properties, Select Query Store.
on General Properties Enable set to —True.
After enabling this feature, I ran few quires and.
To view statistic information, Expand Database that enable for Query store(my case I enabled query store on Adventureworks2014)
Expand Query store and select Top Resources Consuming quires. it will display graphs along with plans.