Monitoring the Plan Cache

You can view and get information about the query plans currently in plan cache memory by using some of the DMVs available in SQL Server 2008. Following are some of the useful ones related to monitoring the plan cache:

sys.dm_exec_cached_plansReturns general information about the query execution plans currently in the plan cache.

sys.dm_exec_query_statsReturns aggregate performance statistics for cached query plans.

sys.dm_exec_sql_textReturns the text of the SQL statement for a specified plan handle.

sys.dm_exec_cached_plan_dependent_objectsReturns one row for every dependent object of a compiled plan.

sys.dm_exec_plan_attributesReturns one row per attribute associated with the plan for a specified plan ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.