Skip to content

Getting Query Execution Plans

beumof edited this page Mar 29, 2019 · 1 revision

Getting Query plans

To get the ACTUAL query execution plan, the query must be running. Else you will only be able to get an ESTIMATED execution plan by querying the SQL query plan cache.

Actual query execution plan

How-to get the execution plan of already running processes

QEP_AlreadyRunningProcesses.sql

How-to get the execution plan of a query not running

You must be able to execute the query. Activate the option "Include Actual Execution Plan" in SSMS (Query menu) or just press Ctrl+M Execute the query and get to the "Execution plan" tab. From there it can also be exported in sqlplan format or XML.

Estimated query execution plans

How-to get the Estimated execution plan

QEP_EstimatedExecutionPlans.sql

Recommended Readings