16 October 2012

SQL Server Execution Plans, Second Edition, by Grant Fritchey

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.

1579-SQLServerExecutionPlans_x200.gif

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.

Keep up to date with Simple-Talk

For more articles like this delivered fortnightly, sign up to the Simple-Talk newsletter

Downloads

This post has been viewed 23373 times – thanks for reading.

Tags: , , , , , , , ,

  • Rate
    [Total: 26    Average: 4.7/5]
  • Share

Grant Fritchey

View all articles by Grant Fritchey

  • dhutton27

    Sample Code
    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

  • BlackhawkEH

    Page 23 Errata
    The level of selectivity is listed as x% on page 23. Was this intentional or is this supposed to be an actual value?

  • Grant Fritchey

    x%
    No, that’s a mistake. Sorry.

  • lesnic

    Enjoying reading the book
    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)

  • terry.davis

    Source code
    Grant, how do I obtain the SQL source code?

  • terry.davis

    Source code
    Grant, how do I obtain the SQL source code?

  • Grant Fritchey

    Re: Source Code
    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.

  • Andrew Clarke

    Re: Source Code
    The source code is there now

  • Andrew Clarke

    Re: Source Code
    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.

  • Grant Fritchey

    Source Control
    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.