SQLServerCentral

SQL Server Execution Plans


https://www.sqlservercentral.com/Forums/Topic657342.aspx

By Grant Fritchey - Sunday, February 15, 2009 2:44 AM

Comments posted to this topic are about the item SQL Server Execution Plans
By rajesh_r_Varma - Monday, September 7, 2009 5:10 PM

its really great book.
Many Thanks to Author of this book.

Thanks,
Rajesh Varma
By Grant Fritchey - Monday, April 19, 2010 11:29 PM

I had no idea this little forum existed.

You're welcome. I'm glad the book was at all useful.
By Abrar Ahmad_ - Sunday, April 3, 2011 6:10 PM

Grant, if following tiny confusion can be explained?

Do DMV/Fs provide "Actual Execution Plan" or "Estimated Execution plan" specially Sys.DM_exec_Query_Plan?


Logically it should be "Actual Execution Plan" rather than "Estimated Execution plan"! But XML from DMV/Fs does not contain any <RunTimeInformation> tag! :-)

Thanks!

By Grant Fritchey - Sunday, April 3, 2011 11:09 PM

Abrar Ahmad_ (4/4/2011)
Grant, if following tiny confusion can be explained?

Do DMV/Fs provide "Actual Execution Plan" or "Estimated Execution plan" specially Sys.DM_exec_Query_Plan?


Logically it should be "Actual Execution Plan" rather than "Estimated Execution plan"! But XML from DMV/Fs does not contain any <RunTimeInformation> tag! :-)

Thanks!



What you are pulling out of the cache is an estimated plan. The actual plans, with performance metrics based on the parameters passed are not stored.
By Koen Verbeeck - Sunday, July 10, 2011 6:06 PM

Thanks for the book!
By Ninja's_RGR'us - Sunday, July 10, 2011 10:57 PM

Hey grant I've surfed to http://www.scarydba.com/2008/07/02/code-from-dissecting-sql-server-execution-plans/ to download the code of the book and I just can't seem to find the download button.

Care to help a blind man?
By CDA - Monday, July 11, 2011 1:46 AM

first great book; thanks for the free download.

I've passed this on to my team for recommended reading.

second question: why does the word Kindle in front of Ebook bump the price 10 bucks? Smile
By Ninja's_RGR'us - Monday, July 11, 2011 1:51 AM

CDA (7/11/2011)
second question: why does the word Kindle in front of Ebook bump the price 10 bucks? Smile


IIRC that book first came out on amazon. Then it was brought in to simple-talk as a free gift.

All in all the 1000s of hors spent writing the book were supposed to bring in some $. So I guess this is why the 10$ for kindle edition.


P.S. The kindle link does not work.
By Daniel Bowlin - Monday, July 11, 2011 2:01 AM

Thanks for the download, I have been struggling with understanding this topic for a while. I am sure this will help.
By Trey Staker - Monday, July 11, 2011 4:44 AM

Grant, Thanks for writing this book and thanks to you and red gate for putting online for free in PDF format.
By Grant Fritchey - Monday, July 11, 2011 10:18 AM

Ninja's_RGR'us (7/11/2011)
Hey grant I've surfed to http://www.scarydba.com/2008/07/02/code-from-dissecting-sql-server-execution-plans/ to download the code of the book and I just can't seem to find the download button.

Care to help a blind man?


Not sure. I usually just google for it. It's online somewhere, either here or over at Red Gate.
By Grant Fritchey - Monday, July 11, 2011 10:18 AM

CDA (7/11/2011)
first great book; thanks for the free download.

I've passed this on to my team for recommended reading.

second question: why does the word Kindle in front of Ebook bump the price 10 bucks? Smile


Not a clue. But if you search for it, you can get it as a PDF for free.
By Grant Fritchey - Monday, July 11, 2011 10:19 AM

Trey Staker (7/11/2011)
Grant, Thanks for writing this book and thanks to you and red gate for putting online for free in PDF format.



Thanks. I hope it's helpful.
By Hardy21 - Wednesday, July 13, 2011 2:32 PM

Really nice book. Thanks Grant Fritchey
By Laurence Neville - Thursday, November 10, 2011 11:35 PM

Hi Grant,
One question about the book:

You refer a couple of times to indexed views that "only refresh once per day". My understanding was that indexed views are updated instantly when base table data is updated, and I can only find references to Oracle materialised views having this "refresh" function. Is there something I am missing?

Thanks
By Ninja's_RGR'us - Thursday, November 10, 2011 11:42 PM

Laurence Neville (11/11/2011)
Hi Grant,
One question about the book:

You refer a couple of times to indexed views that "only refresh once per day". My understanding was that indexed views are updated instantly when base table data is updated, and I can only find references to Oracle materialised views having this "refresh" function. Is there something I am missing?

Thanks



It's probably something like a temp reporting table loaded from a view.

Your understanding of the indexed views is correct.
By s.pig.snow - Sunday, November 13, 2011 7:33 PM

Grant, I confused for a question when I'm reading <Dissecting SQL Server
Execution Plans>:


Following two T-SQL generate two different plans, but I don't know why:

--Clustered index scan
SELECT ContactID,LastName,EmailAddress FROM person.Contact WHERE EmailAddress LIKE 'sa%'
--NonClustered index seek and Key Lookup
SELECT ContactID,LastName,EmailAddress FROM person.Contact WHERE EmailAddress LIKE 'sab%'


Would you give me some suggestion please?
Thanks a lot.

s.pig.snow@gmail.com
By Ninja's_RGR'us - Sunday, November 13, 2011 9:21 PM

Sab must return less rows.

An index seek + bookmark lookup is a very costly operation. It takes very little data returned to make a table scan more efficient than a seek + lookup.
By GilaMonster - Sunday, November 13, 2011 9:27 PM

This: http://sqlinthewild.co.za/index.php/2009/01/09/seek-or-scan/
By Ninja's_RGR'us - Sunday, November 13, 2011 9:33 PM




And make sure to read this excellent comment at the end!

http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx

Hehe
By Grant Fritchey - Monday, November 14, 2011 10:58 PM

Sounds like you guys covered it all better than I would have. Thanks!