Find Query Reuse (Execution Plan Reuse)
-
Posted on May 31, 2009 by Derek Dieter
-
0
[cc lang=”sql”]
— 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
[/cc]
Post a comment
- Comments (RSS)
- Trackback
- Permalink
2 comments