Categories:

An estimated execution plan is a SQL Server query plan that is generated without actually running the query. An actual execution plan is the SQL Server query plan that is generated after a query was executed.

To list all active execution plans use the query:

SELECT [cp].[refcounts]
, [cp].[usecounts]
, [cp].[objtype]
, [st].[dbid]
, [st].[objectid]
, [st].text
, [qp].[query_plan]
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st
CROSS APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;

Tags:

Comments are closed