Microsoft SQL Server Remove data from query store


Example

If you want to remove some query or query plan from query store, you can use the following commands:

EXEC sp_query_store_remove_query 4;
EXEC sp_query_store_remove_plan 3; 

Parameters for these stored procedures are query/plan id retrieved from system views.

You can also just remove execution statistics for particular plan without removing the plan from the store:

EXEC sp_query_store_reset_exec_stats 3;  

Parameter provided to this procedure plan id.