SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stairway to SQL Server Indexes: Step 9, Reading Query Plans


Stairway to SQL Server Indexes: Step 9, Reading Query Plans

Author
Message
David Durant
David Durant
SSC Veteran
SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)SSC Veteran (242 reputation)

Group: General Forum Members
Points: 242 Visits: 23
Comments posted to this topic are about the item Stairway to SQL Server Indexes: Step 9, Reading Query Plans
Paul White
Paul White
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36008 Visits: 11361
In the 'Viewing Parallel Streams' section you claim that both 'streams' are read in parallel. A hash join is a partially-blocking iterator: it consumes all rows from the build input to create the hash table, and then probes for matching rows one at a time from the probe input. This is clearly documented in Books Online - see Understanding Hash Joins.



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
permono.sam
permono.sam
Valued Member
Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)

Group: General Forum Members
Points: 68 Visits: 136
Greetings,

As I have just read this part of articles. A question arise in my mind :-D about figure 5. As my I understanding after reading untill part 9 is:

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


I think 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 :-).
kagi.jagi
kagi.jagi
SSC Rookie
SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)

Group: General Forum Members
Points: 38 Visits: 223
I think the index has all it needs, including SalesOrderID column, because this column is in the bookmark of the index.
Bookmarks of non-clustered indexes are values of clustered index if the table is clustered index.

You can check that easy - just replace it in SELECT statement with any other column of SalesOrderHeader table. It will be again parallized.
Tac11
Tac11
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1537 Visits: 1159
Can you please tell me how did you find looking at execution plan 'Contact' rows are problem?
"The new plan also shows us that the increased number of Contact rows has caused the Match and Sort operations to become the critical path for this query."
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search