November 6, 2011 at 6:58 pm
Greetings,
I am learning about database index right now, thru reading "Stairway to SQL Server Indexes: Step 9..." http://www.sqlservercentral.com/articles/Stairway+Series/72441/. There is some thing I don't understand. It said with query below:
SELECT C.LastName, C.FirstName, C.MiddleName, C.Title, H.SalesOrderID, H.OrderDate
FROM Person.Contact C
JOIN Sales.SalesOrderHeader H ON H.ContactID = C.ContactID
WHERE Suffix is null
ORDER BY Title
the query plan would be as figured as number 5. And I already test it in SSMS.
I thought the query plan should be still like figure 4 (not changing). This is because index IX_ContactID which added later does not give more advantage (lack field SalesOrderID to show for final output). How come with new index IX_ContactID and Clustered Index of table Contact, we can produce field SalesOrderID for final result?
Please give me enlightenment here.
Thanks in advance.
November 7, 2011 at 2:25 am
Maybe post this in the comments of the article?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply