Click here to monitor SSC
  • Av rating:
  • Total votes: 20
  • Total comments: 11

SQL Server Execution Plans, Second Edition, by Grant Fritchey

16 October 2012
SQL Server Execution Plans, 2nd Edition, By Grant Fritchey

Free eBook download (PDF): Download here.
Buy the printed book: $29.99

Every day, out in the various online forums devoted to SQL Server, and on Twitter, the same types of questions come up repeatedly: Why is this query running slowly? Why is SQL Server ignoring my index? Why does this query run quickly sometimes and slowly at others? My response is the same in each case: have you looked at the execution plan?

An execution plan describes what's going on behind the scenes when SQL Server executes a query. It shows how the query optimizer joined the data from the various tables defined in the query, which indexes it used, if any, how it performed any aggregations or sorting, and much more. It also estimates the cost of all of these operations, in terms of the relative load placed on the system.

Every Database Administrator, developer, report writer, and anyone else who writes T-SQL to access SQL Server data, must understand how to read and interpret execution plans. My book leads you right from the basics of capturing plans, through how to interrupt them in their various forms, graphical or XML, and then how to use the information you find there to diagnose the most common causes of poor query performance, and so optimize your SQL queries, and improve your indexing strategy.

Grant Fritchey

Author profile:

Grant Fritchey is a SQL Server MVP with over 20 years’ experience in IT including time spent in support and development. Grant has worked with SQL Server since version 6.0 back in 1995. He has developed in VB, VB.Net, C# and Java. Grant has authored books for Apress and Simple-Talk, and joined Red Gate as a Product Evangelist in January 2011. Find Grant on Twitter @GFritchey or on his blog.

Search for other articles by Grant Fritchey

Rate this article:   Avg rating: from a total of 20 votes.


Poor

OK

Good

Great

Must read
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Sample Code
Posted by: dhutton27 (view profile)
Posted on: Monday, March 4, 2013 at 7:58 AM
Message: Hello,

Enjoying your book "Dissecting SQL Server Execution Plans" but can't seem to find the sample code here that goes with it. I've searched on this web page for the book but can only find you second edition. Where might I find this.
Thanks

Duane

Subject: Page 23 Errata
Posted by: BlackhawkEH (view profile)
Posted on: Monday, April 22, 2013 at 7:50 AM
Message: The level of selectivity is listed as x% on page 23. Was this intentional or is this supposed to be an actual value?

Subject: x%
Posted by: Grant Fritchey (view profile)
Posted on: Tuesday, April 23, 2013 at 9:14 AM
Message: No, that's a mistake. Sorry.

Subject: Enjoying reading the book
Posted by: lesnic (view profile)
Posted on: Wednesday, August 7, 2013 at 4:44 AM
Message: I think there's a slip on page 91:

... joins them by scanning the outer data set (the bottom operator in a graphical execution plan)

should read

... joins them by scanning the outer data set (the top operator in a graphical execution plan)

Subject: Source code
Posted by: terry.davis (view profile)
Posted on: Monday, November 25, 2013 at 8:24 AM
Message: Grant, how do I obtain the SQL source code?

Subject: Source code
Posted by: terry.davis (view profile)
Posted on: Monday, November 25, 2013 at 11:32 AM
Message: Grant, how do I obtain the SQL source code?

Subject: Re: Source Code
Posted by: Grant Fritchey (view profile)
Posted on: Monday, November 25, 2013 at 12:44 PM
Message: I'm pretty sure it's somewhere here on Simple-Talk, but it looks like the link is missing. I'll contact the guys that run the site.

Subject: Re: Source Code
Posted by: Andrew Clarke (view profile)
Posted on: Tuesday, November 26, 2013 at 9:54 AM
Message: The source code is there now

Subject: Re: Source Code
Posted by: terry.davis (view profile)
Posted on: Wednesday, November 27, 2013 at 9:47 AM
Message: Please let me know where "there" is.

The book points to https://www.simple-talk.com/REDGATEBOOKS/GRANTFRITCHEY_SQLSERVEREXECUTIONPLANSCODE.ZIP
but I only get a "file not found".

Subject: Re: Source Code
Posted by: Andrew Clarke (view profile)
Posted on: Wednesday, November 27, 2013 at 10:17 AM
Message: If you look at the head of the article on this page, you will see a link underneath the 'stars' rating, under the heading 'Downloads' that says 'Source code for the book'. If you click on this, your browser should download the zip file. The source code for the book is in the zip file.
I've just checked the link from the book, which is
http://www.simple-talk.com/RedGateBooks/GrantFritchey_SQLServerExecutionPlans_Code.zip
and it works fine. In fact, that is where I got the zip for the 'download' section of this article.

Subject: Source Control
Posted by: Grant Fritchey (view profile)
Posted on: Wednesday, November 27, 2013 at 11:36 AM
Message: I just checked the link from the book. It seems to work fine. I should have checked there first.

I see you have HTTPS instead of HTTP. I suspect that might be the problem you were hitting. The book doesn't list either.

 

Recommended site

PInvoke.net is a user-driven wiki which provides .NET developers with native method signatures, so they don't have to spend time writing them from scratch.

Check out PInvoke.net!

Top Rated

SQL Server Source Control Basics
 For efficient team-based database development, and reliable and repeatable database deployments, source... Read more...

Book Review: Optimizing And Troubleshooting Hyper V Networking 2013
 If you want to learn how to optimize and troubleshoot Hyper-V, then this book, written by Microsoft... Read more...

Don't Just Roll the Dice - eBook Download
 Neil Davidson has created a short handbook with the theory, practical advice and case studies, to... Read more...

Captain Biplane: Interplanetary Airman
 Simple-Talk caters for the lighter side with its publication of 'Captain Biplane: Interplanetary... Read more...

Book Review: Windows Server 2012 Hyper-V Cookbook
 Windows Server 2012 Hyper-V Cookbook is a comprehensive resource for administrators and consultants... Read more...

Most Viewed

Troubleshooting SQL Server: A Guide for the Accidental DBA
 Three SQL Server MVPs, and stalwarts of the SQLServerCentral and MSDN community forums, provide... Read more...

Exchange 2010 - A Practical Approach
 Jaap's Practical Guide to Exchange Server 2010 draws upon all that experience to deliver an easy-to-use... Read more...

Brad's Sure Guide to SQL Server Maintenance Plans
 Brad's Sure Guide to Maintenance Plans shows you how to use the Maintenance Plan Wizard and Designer to... Read more...

Inside the SQL Server Query Optimizer
 This book will take you from the fundamentals of Statistics, Cost Estimation, Index Selection, and the... Read more...

SQL Server Hardware
 SQL Server Hardware will provide the fundamental knowledge and resources you need to make intelligent... Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.