"Tribal SQL" is an interesting book, so I will be reviewing some, although not all, of its chapters.
Quoting from the introduction, "This is a book for DBAs, for things you think they really ought to know".
As an agile developer, I clearly do not belong in this book's target audience. Also I am not qualified to review some of the chapters, as I have zero real life experience with some of the technologies described in it.
I will not be reviewing these chapters.
As a developer frequently working with RDBMS, I am much more productive when I understand the underlying RDBMS, and develop software that utilizes the strengths and avoids the weaknesses of the RDBMS I currently work with. This is why I am curious about SQL Server, and this is why some of the chapters in "Tribal SQL" are really interesting to me.
So, the following series of posts is written by a developer, and targeted at developers.
Review for "SQL Server Internals 101"
Mark S Rasmussen has written a chapter entitled "SQL Server Internals 101".
This chapter is very relevant for us developers - to deliver robust and performant systems,
we do need to have some knowledge of internals.
Quoting from the author, "... every SQL Server DBA and developer should have a sound basic understanding,
not just of what storage objects exist in SQL Server (heaps and indexes), but of the underlying data structures".
This rings true to me - in all my experience it is cheaper to invet some time, learn the internals, and avoid very costly mistakes.
The author begins with a personal story, describing his own mistake caused by insufficient knowledge.
This is exactly what's needed to grab readers' attention.
The story definitely resonates with me - I did make some mistakes with SQL Server databases myself, and who did not? These days I develop against PostgreSql a lot, and maybe I am doing something wrong with my PostgreSql systems as well, and need better knowledge of it.
This story is followed by an introduction into records and pages, and a practical hands on way to look directly into bytes and bits these pages consist of.
This is followed by an practical introduction into B-trees, indexes, both clustered and non-clustered, and heaps.
The details on heaps and clustered indexes are especially necessary, because this is where SQL Server is so different from PostgreSQL and Oracle.
This chapter is a highly practical introduction into a very relevant topic. It has been written for busy practitioners, including developers - it starts with explaining why we want to know all these things, then it clearly and succinctly explains the basics, and refers to more detailed resources for further learning.