Review of SQL Performance Explained by Markus Winand

I picked up a copy of SQL Performance Explained last week, after having been a long time fan of Markus’ site Use The Index, Luke!.

What I love the most about use-the-index-luke, is the 3-minute-test. Seriously – try taking it!

Anyway, here is what I have to say about the book:

SQL Performance Explained
  • Quality : The book is not published by a major publisher, so I was not sure if I should expect a bound stack of photocopies. To my delight, it is the same quality as any other book, and clearly has a copy editor. I didn’t notice any gramatical or copy errors.

  • Length : It is a short book at 164 pages + 28 pages of appendixes. I personally love this – because the author has focused on what is important, and not added introductory chapters at the pressure of a publisher to expand page count. I kept wondering if it could be smaller (in an effort to make sure every developer on a team reads it), but I don’t think this is reasonable either. I thought it was smart in the preface to say that the book only covers B-tree indexes, and the length was therefor “about right”.

  • Content : Very high quality content – it is simply amazing that one author has this depth of knowledge on 4 different database vendors (Oracle, SQL Server, MySQL and PostgreSQL). I like the organization which is largely around statement level behavior, and keeps it a developer-focused book. I also like that the first chapter dives right into the thick of it by describing the anatomy of an index. The theory aspect of this chapter may be a little bit difficult for developers with less of a low-level background to grasp in one read – but I couldn’t think of any other way around it. It covered a good/appropriate level of detail.

  • Small Criticisms : Sometimes it is difficult to be generic in advice, and keep in mind that this book covers Oracle, SQL Server, MySQL and PostgreSQL. I think the book did pretty well – but I did notice an example in Chapter 2, where it describes an index range scan (p39) that I know is not possible until Index Condition Pushdown in MySQL 5.6. It did warn that composite indexes should be in the form const, range but for MySQL the wording probably should have been a little stronger. I don’t want you to take this criticism too seriously as well. If the author were to give database specific and version specific advice, it would make for a very dull read.

Overall:
As the author himself says, SQL does a good job at separating out what data is needed from how data will actually be retrieved. This makes performance characteristics not always clear cut.

I think that for a development team building database applications everyone understanding these basic characteristics is like a chef knowing how to cook an omelette – it is such a critical fundamental that will never go away.

If there are developers that aren’t getting 5/5 on the Use the Index, Luke! 3-minute-test, then I can’t think of a better resource to get them there. The book is a short read, and to the point!

Final rating: 4.5 stars.

Buy the book online from sql-performance-explained.com.

Published by

morgo

I joined MySQL AB in 2006, left, and am now back at Oracle working on the MySQL team. I’ve also worked at Percona and InPowered.