Generating and Saving Execution Plans in SQL Server Management Studio

Before and after the execution of the query, the execution plans in SQL Server. Actual and estimated execution plans can be achieved by the given steps:

Generation of Actual Execution Plans

The actual execution plan can be achieved in the following ways in SQL Server:

  1. After completely writing the query, Press Ctrl+M, and the actual execution plan will be generated. 
  2. Go to the query window and right-click on it, then click on the context menu and select ‘Display Actual Execution Plan’.
  3. Or the ‘Display Actual Execution Plan’ icon can be directly selected from the toolbar.

Generation of Estimated Execution Plans

An estimated execution plan can be achieved using the following ways in SQL Server:

  1. After completely writing the query, Press Ctrl+L, and the plan will be generated. 
  2. Go to the query window and right-click on it, then click on the context menu and select “Display Estimated Execution Plan“.
  3. Or the “Display Estimated Execution Plan” icon can be directly selected from the toolbar.

Query Execution Plan in SQL

A query execution plan (also known as a query plan) is a sequence of steps used by a relational database management system (RDBMS) to access data efficiently when executing a query. The query plan is also referred to as the SQL Server execution plan.

The query optimizer generates the SQL Server execution plan or query plan. Its goal is to generate an optimal economic query plan. Multiple execution plans are generated by the query processing engine after query execution, and from those generated execution plans, a plan with the best performance is selected.

The execution plans are stored in the plan cache memory location, from where they can be reused. Execution plans are available in 3 forms in the SQL server: XML plans, Graphical plans, and Text plans.

Here, we will learn all about Query-Execution Plans in SQL, understand the types of query execution plans, how to create query plans, and at last how to save query plans in SQL Server.

Similar Reads

Types of Execution Plan in SQL

There are two types of Execution Plans in SQL:...

Generating and Saving Execution Plans in SQL Server Management Studio

Before and after the execution of the query, the execution plans in SQL Server. Actual and estimated execution plans can be achieved by the given steps:...

How to save a Query Execution plan?

One has to save the query plan after interpreting the plan produced by the query. SQL Server Management Studio has an extension of “.sqlplan” for saving the plan in the system....

Conclusion

In this article, we learn about query-execution plan in SQL. We covered the meaning of SQL Query plans, it’s types and how to create and save these query plans in SQL Server....

Contact Us