Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 3.57 KB

File metadata and controls

44 lines (34 loc) · 3.57 KB
title Display and save Execution Plans
description Learn how to display execution plans and how to save execution plans to a file in XML format by using SQL Server Management Studio.
author MikeRayMSFT
ms.author mikeray
ms.reviewer randolphwest
ms.date 01/26/2026
ms.service sql
ms.subservice performance
ms.topic how-to
ms.custom
ignite-2025
helpviewer_keywords
Showplan results
execution plans [SQL Server]
queries [SQL Server], tuning
execution plans [SQL Server], how-to topics
SQL Server Management Studio [SQL Server], execution plans
tuning queries [SQL Server]
monikerRange =azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric-sqldb

Display and save execution plans

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

This section explains how to display execution plans and how to save execution plans to a file in XML format by using [!INCLUDE ssManStudioFull] (SSMS).

Execution plans graphically display the data retrieval methods chosen by the [!INCLUDE ssNoVersion] Query Optimizer. Execution plans represent the execution cost of specific statements and queries in [!INCLUDE ssNoVersion] using icons rather than the tabular representation produced by the SET SHOWPLAN_ALL or SET SHOWPLAN_TEXT statements. This graphical approach is useful for understanding the performance characteristics of a query.

While the [!INCLUDE ssNoVersion] Query Optimizer produces only one execution plan, there's the concept of estimated execution plan, an actual execution plan, and live query statistics.

  • An estimated execution plan returns the compiled plan as produced by the Query Optimizer, based on estimations. This is the query plan that is stored in the plan cache. Producing the estimated execution plan doesn't actually execute the query or batch, and therefore doesn't contain any runtime information, such as actual resource usage metrics or runtime warnings.

  • An actual execution plan returns the compiled plan plus its execution context. It becomes available after the query execution has completed. This plan includes actual runtime information such as execution warnings, and in newer versions of the [!INCLUDE ssDE-md], the elapsed and CPU time used during execution.

  • Live query statistics return the compiled plan plus its execution context. This plan is available for in-flight query executions, and is updated every second. This includes runtime information such as the actual number of rows flowing through the operators, elapsed time, and the estimated query progress.

For more information on query execution plans, see the Query processing architecture guide.

Related content