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


Understanding Graphical Execution Plans - Part 1: Explaining the Plan


Understanding Graphical Execution Plans - Part 1: Explaining the Plan

Author
Message
darrenwhite
darrenwhite
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 86
Comments posted to this topic are about the item Understanding Graphical Execution Plans - Part 1: Explaining the Plan
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54626 Visits: 32776
Nicely done. Absolutely excellent first article.

If I may, I'd like to clarify a couple of points. I wouldn't classify XML as a separate plan type (although I probably did in older editions of my book). The XML plan and the graphical plan are one and the same. It's just how they're displayed.

For when estimated and actual plans differ, again, nice job, but you might have made the point a little differently. The examples you show are likely to have the plan itself be the same between estimated and actual, but with differences in the details. The main cause of differences between estimated and actual plans, when the plans change, is recompiles.

On the parallelism, that's a mistake I made in my first book. It's wrong. There are not two plans. There is one. Sorry.

Again, nice job. Looking forward to the other articles.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
harsh.info
harsh.info
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 138
Nice post.

Is there a way to determine memory granted to query just before execution and the actual memory it used during runtime. Can we get this information from execution plans.
SQLRNNR
SQLRNNR
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40241 Visits: 18565
Well done on the first article. Also, very useful information from Grant.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

rchantler
rchantler
Old Hand
Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)

Group: General Forum Members
Points: 305 Visits: 595
"If an object in the query does not exist, the validation fails and no estimated plan is created"

Is something executed in this case, i.e. is there an actual execution plan?
darrenwhite
darrenwhite
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 86
Thanks for the clarifications, Grant. After researching available material on execution plans, I can appreciate the amount of work that you had to put in to write your book. It is the only real source there is. The material from Microsoft on the topic is almost non-existent.
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54626 Visits: 32776
rchantler (2/18/2014)
"If an object in the query does not exist, the validation fails and no estimated plan is created"

Is something executed in this case, i.e. is there an actual execution plan?


No. You don't get a plan. That's an earlier part of the process than plan creation, so nothing is done from there.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
darrenwhite
darrenwhite
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 86
"If an object in the query does not exist, the validation fails and no estimated plan is created"

If you try to create an estimated execution plan in this case, you will get an error that the object does not exist and no estimated plan will be created. If you specify to include the actual plan when executing, then the SQL will be executed and the actual plan will be displayed.
darrenwhite
darrenwhite
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 86
"Is there a way to determine memory granted to query just before execution and the actual memory it used during runtime. Can we get this information from execution plans. "

You can determine the memory to some degree. The actual plan will list the estimated row size, the estimated rows and the actual rows. From this you can calculate an estimated amount of memory used by the data returned.
kkp40
kkp40
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 3
Nice.

I would like to read about how to use the execution plans to understand what to change in my sql-query, or in the table, to make it better.
I can read and understand a graphical execution plan but I don't understand where, what and how to tweak to make it better.
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