Navigating a query plan
Up until this point, we have mentioned query execution plans, and even shown simple examples to illustrate some points during the Mechanics of the Query Optimizer chapter. However, it is important for any database professional to understand how to read and analyze a query execution plan as a way to visually identify positive changes in a plan shape. The remaining chapters in the book will show query execution plans in more detail for different scenarios of T-SQL patterns and anti-patterns.
Query plans are like trees, where each join branch can represent an entirely separate query. To understand how to navigate a showplan or query plan, let’s use a practical example of a query executed in the AdventureWorks
sample database:
SELECT p.Title + ' ' + p.FirstName + ' ' + p.LastName AS FullName, c.AccountNumber, s.Name AS StoreName FROM Person.Person p INNER JOIN Sales.Customer c ON c.PersonID = p.BusinessEntityID INNER JOIN Sales.Store...