Disabling and cleaning Query Store

You might need to remove collected data from Query Store sometimes. For instance, when you use it for demo purposes or when you fixed queries that were a long time in regression and will be shown in Query Store reports in the next period too, because of their significant regression. You can remove captured information by clicking on the Purge Query Data button in the Query Store properties page inside SQL Server Management Studio (see Figure 9.3).

In addition to this, you can use the following Transact-SQL command:

ALTER DATABASE WideWorldImporters SET QUERY_STORE CLEAR;  

To disable Query Store, you would need to set operation mode property to Off either through SQL Server management studio (Query Store page within ...

Get SQL Server 2016 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.