# Get an execution plan

> Display the estimated (Ctrl+L) or actual (Ctrl+M) execution plan of a SQL Server query in SSMS, then save it to a .sqlplan file.
>
> Source : https://www.pachadata.com/en/docs/howtos/performance/execution-plan/
> Author : Rudi Bruchez · updated 2026-10-14
> Markdown version of the page, for tools and LLMs. The HTML page is the reference.


Every query is optimized by the SQL Server query optimizer, which builds an execution plan — also called a query plan — to decide the strategy the execution engine will follow.

Looking at that plan is how you find opportunities to optimize a query.

There are two of them:

- the *estimated* plan, more accurately described as the plan before execution;
- the *actual* plan, more accurately described as the plan after execution.

## Estimated plan

- Display the plan **before** execution by selecting a query in SSMS and pressing **Ctrl+L**.
- You can also use this button in the SSMS toolbar.

![Estimated execution plan button in the SSMS toolbar](/images/docs/howtos/execution-plan_media/execution-plan-01.png)

- Once the plan is displayed, right-click the graphical plan and choose *Save execution plan as…* from the context menu.
- Save it to a file with the `.sqlplan` extension.

## Actual plan

- Display the plan **after** execution by selecting a query in SSMS and pressing **Ctrl+M**.
- You can also use this button in the SSMS toolbar.

![Actual execution plan button in the SSMS toolbar](/images/docs/howtos/execution-plan_media/execution-plan-02.png)

- Then run the query. Once it completes, the execution plan appears graphically in a tab of the results pane.

![Graphical execution plan in the SSMS results pane](/images/docs/howtos/execution-plan_media/execution-plan-03.png)

- Once the plan is displayed, right-click the graphical plan and choose *Save execution plan as…* from the context menu.
- Save it to a file with the `.sqlplan` extension.


---

## About the author

Rudi Bruchez, independent SQL Server consultant since 2006: performance audits, tuning, migrations, high availability and training. For an audit or hands-on help on your server: https://www.pachadata.com/en/contact/ (remote audit: https://www.pachadata.com/en/services/remote-sql-server-audit/).
