SQL Server Execution Plan – How to Check Actual Plan After Query Execution

execution-plansql server

In SQL Server, how can we see actual execution plan of a query, after it has been executed?

As per my knowledge, only estimated execution plan (not actual execution plan) are stored in plan cache. is that correct?

Note: We do not have any third party monitoring tools.

Best Answer

If you're running SQL Server 2012 or above, you could consider creating an Extended Events session and configure it to capture the query_post_execution_showplan event to capture the actual execution plan after the query has been executed. But obviously the session would need to be setup and enabled prior to query execution.

However, be aware that enabling this event will impact performance so this is probably something you'd want to switch on for investigative purposes, then switch off again once you've captured the plan you're after.