During the course of my work day, I spend the bulk of my programming time working with SQL Server: writing queries to retrieve data from our expansive scheme, creating or updating records, or designing new table structures to support exciting features. Recently, I’ve added “making slow SQL go faster” to the list of things I expect to be able to do well.
Towards that end, I’m attempting to immerse myself in the technicalities of how SQL Server does what it does and how my choices as a developer can affect that. In addition to taking classes and reading books specifically about query tuning and optimization, I thought an internals book would provide some much-needed context about what really happens behind the scenes.
It’s still too soon to tell if that will pan out but if it doesn’t, it would be no fault of this book. This book is an excellent deep dive into how SQL Server manages all of that precious data we shove into it every day.
While being highly technical and detailed, it’s also approachable. The style is easy to read and it’s filled with diagrams and pictures that help a brain figure out what’s going on. I can now have intelligent conversations about how inserts into clustered indexes are managed (down to the page level) and how the query optimizer will choose between competing plans to handle a lot of joins. I know what’s going on when I type “select *” in ways that I never did before [Ed: I’d never type “select *”…].
That said, the most beneficial part of this book is how it describes the functions available in SQL Server for me to see how my own data is organized. It explains the various methods available for me to see how pages are allocated across indexes, what’s currently in my plan cache, what physical operations the database has been performing lately, and more. I’ve been keeping a file of useful queries to run and I expect I’ll be using this file for the next several years.
If this book has any faults, it’s largely that it skips some of the newer features that we use a lot. As an example, I could really use more information about XML parsing in general (and XML indexes in particular) and how the database feeds data to the CLR when running CLR code. Still, these are small complaints since the majority of my workload uses the bread and butter stuff that this book describes.
I think (and hope?) that reading this book will play a part in moving me from being an adequate or advanced SQL Server developer to an expert one.