Download from Wow! eBook For your convenience Apress has placed some of the front matter material after the index Please use the Bookmarks and Contents at a Glance links to access them SQL Server 2012 Query Performance Tuning Grant Fritchey Contents at a Glance About the Author xxiii About the Technical Reviewer xxv Acknowledgments xxvII Introduction xxix ■■Chapter 1: SQL Query Performance Tuning ■■Chapter 2: System Performance Analysis 15 ■■Chapter 3: SQL Query Performance Analysis 59 ■■Chapter 4: Index Analysis .99 ■■Chapter 5: Database Engine Tuning Advisor .149 ■■Chapter 6: Lookup Analysis 163 ■■Chapter 7: Statistics Analysis 175 ■■Chapter 8: Fragmentation Analysis 211 ■■Chapter 9: Execution Plan Cache Analysis .241 ■■Chapter 10: Query Recompilation .281 ■■Chapter 11: Query Design Analysis 313 ■■Chapter 12: Blocking Analysis .349 ■■Chapter 13: Deadlock Analysis 393 iii ■ Contents at a Glance ■■Chapter 14: Cursor Cost Analysis .407 ■■Chapter 15: Database Performance Testing 429 ■■Chapter 16: Database Workload Optimization 437 ■■Chapter 17: SQL Server Optimization Checklist .469 Index 489 iv About the Technical Reviewer Joseph Sack is a Principal Consultant with SQLskills He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail, and the real estate industry Prior to joining SQLskills, he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance His areas of expertise include performance tuning, scalability, T-SQL development, and high-availability In 2006 Joe earned the “Microsoft Certified Master: SQL Server 2005” certification; and in 2008, he earned the “Microsoft Certified Master: SQL Server 2008” certification In 2009 he took over responsibility for the SQL Server Microsoft Certified Master program and held that post until 2011 He is the author of a few books and white papers, including most recently, “SQL Server 2008 Transact-SQL Recipes” (Apress, 2008) Joe’s blog is at www.SQLskills.com/blogs/joe, and he can be reached at joe@SQLskills.com xxv Acknowledgments I said it last time, and it bears repeating: writing a book is really hard Once again, a team of people were assembled to make this entire thing possible From Apress, Jonathan Gennick, thank you once more for placing trust in me to deliver on this crazy thing and all the help you’ve provided; I begged Joseph Sack to come back for one more pass through this book of ours, and I’m so grateful that he agreed to put up with me again There’s no way this book would be worth much without you, Joe Thanks to Anita Castro at Apress for putting up with my poor behavior and keeping me on schedule Everyone, you did the hard work, and it really shows As before, anything that’s wrong with this book is not from anything that you did Thanks I still have to throw a hearty thanks to all the members of The Thread over at the SQL Server Central forums Steve, Gail, Jeff, Jack, Barry, Lynn, Paul, and all the rest I haven’t mention specifically—thank you for all the help over the years I work for the greatest company at Red Gate Software Gareth, Ben, Neil, Simon, and all the team have provided me with so much that there’s no way to list it all I will mention that I used the Red Gate tool, SQL Prompt, to write and format all the T-SQL code in this book While I’m mentioning work, I also want to once more thank the team at FM Global, where I spent ten years learning everything the people there had to teach me Thanks, guys My most important thanks are reserved for my wife and kids I know you guys are well and truly sick of me writing these books all the time; and yet you still let me it and support me as it happens.I appreciate it and I’ll never it again, until the next time Grant Fritchey xxvii ... convenience Apress has placed some of the front matter material after the index Please use the Bookmarks and Contents at a Glance links to access them SQL Server 2012 Query Performance Tuning Grant... Introduction xxix ■■Chapter 1: SQL Query Performance Tuning ■■Chapter 2: System Performance Analysis 15 ■■Chapter 3: SQL Query Performance Analysis 59 ■■Chapter... papers, including most recently, ? ?SQL Server 2008 Transact -SQL Recipes” (Apress, 2008) Joe’s blog is at www.SQLskills.com/blogs/joe, and he can be reached at joe@SQLskills.com xxv Acknowledgments