Skip to content
 

Find Query Reuse (Execution Plan Reuse)

-- find counts of query re-use
SELECT * FROM
(
select *, (select object_name(objectid) from sys.dm_exec_sql_text(p.plan_handle)) AS SNAME
 from sys.dm_exec_cached_plans p
 where usecounts <= 1
--and objtype != 'adhoc' --and objtype != 'prepared'
) t
WHERE SNAME IS NOT NULL
 order by usecounts, size_in_bytes desc


Popular search terms:

post a comment OR Post Your Question on our ASK! Community!