Identifying ad hoc queries

You can use Query Store to identify ad hoc workloads, which are typically characterized by a relatively large number of different queries executed very rarely, and usually only once. Use the following query to identify all queries that are executed exactly once:

SELECT p.query_id 
FROM sys.query_store_plan p 
INNER JOIN sys.query_store_runtime_stats s ON p.plan_id = s.plan_id 
GROUP BY p.query_id 
HAVING SUM(s.count_executions) = 1;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.144.248