In SQL Server, you can use the SET STATISTICS XML
statement to generate detailed information about how a T-SQL statement was executed.
This information is provided in the form of a well formed XML document.
Once SET STATISTICS XML
is set to ON
, each subsequent statement is reflected in the output by a single XML document.
Each XML document contains the text of the statement, followed by the details of the execution steps.
The output shows run-time information such as the costs, accessed indexes, and types of operations performed, join order, the number of times a physical operation is performed, the number of rows each physical operator produced, and more.
Continue reading →