Database Reference
In-Depth Information
SELECT soh.AccountNumber,
sod.LineTotal,
sod.OrderQty,
sod.UnitPrice,
p.Name
FROM Sales.SalesOrderHeader soh
JOIN Sales.SalesOrderDetail sod
ON soh.SalesOrderID = sod.SalesOrderID
JOIN Production.Product p
ON sod.ProductID = p.ProductID
WHERE sod.LineTotal > 20000;
GO
SET SHOWPLAN_XML OFF;
GO
Running this query results in a link to an execution plan, not an execution plan or any data. Clicking the link will
open an execution plan. Although the plan will be displayed as a graphical plan, right-clicking the plan and selecting
Show Execution Plan XML will display the XML data. Figure 7-1 shows a portion of the XML execution plan output.
Figure 7-1. XML execution plan output
Analyzing a Query Execution Plan
Let's start with the costly query identified in the previous query. Copy it (minus the SET SHOWPLAN_XML statements)
into Management Studio, and turn on Include Actual Execution Plan. Now, on executing this query, you'll see the
execution plan in Figure 7-2 .
 
Search WWH ::




Custom Search