Delete from SQL Server 2017 QueryStore dmv issue

221 Views Asked by At

We are using SentryOne, and one of the biggest consumers of IO & CPU resources is the query

delete sys.plan_persist_wait_stats
where Plan_id in (
    select plan_id
    from sys.plan_persist_plan
    where query_id = @query_id
)

I tried to Google it and all what I found is that it relates to the QueryStore. I'm not able to access sys.plan_persist_wait_stats and sys.plan_persist_plan using Select command, and they are not documented.

Any idea what to do?

We are using Microsoft SQL Server 2017 (RTM-CU26).

0

There are 0 best solutions below