on 9 December 2015
I bought this book (on kindle) as I am pursuing the sql certifications and wanted a better background understanding of what is going on underneath. As a .net / sql dev I am not from an admin background and therefore was not overly familiar with the more low level aspects.
This book goes into great detail on subjects such as how data and indexes are physically stored, how queries are executed, and of course compiled and cached too, how back ups and indeed the log file work, and many other things.
The book also quite liberally discusses the DMOs which are provided and which the admin exam likes you to know, amongst other things.
It goes without saying that more reading and practical hands on playing with a test system from an admin perspective is required before taking the various exams, however this is a very good that journey
on 29 January 2014
I have written a detailed chapter-by-chapter review of this book on [...], the first and last parts of this review follow:
The introduction says "This book is intended to be read by anyone who wants a deeper understanding of what SQL Server does behind the scenes", so how does it fare?
This book has a revered pedigree, with previous editions containing some of the most detailed explanation of SQL Server internals available. Additionally, the list of authors reads like a Who’s Who of the SQL Server world.
Owing to the increasing size and complexity of the SQL Server software, this book is selective in its content, concentrating on the query processor and storage engine. It specifically excludes client programming, business intelligence, security, and other non-core engine areas.
Below is a chapter-by-chapter exploration of the topics covered.
Chapter 1 SQL Server 2012 architecture and configuration
This first chapter provides an overview of the database engine, its key components, what they are and how they interact. In essence it aims to put the subsequent chapters into context.
SQL Server editions and installation are briefly discussed. SQL Server metadata is examined in terms of compatibly views, catalog views, Dynamic Management Objects (DMOs), and other metadata (e.g. system functions and stored procedures). This metadata can be very useful in diagnosing problems e.g. identifying what SQL statements are blocking.
The major components of the engine are identified (i.e. protocol layer, query optimization, query execution, storage engine, and the SQL Server Operating System [SQLOS]) and briefly discussed. They are discussed extensively in later chapters.
The SQL Server Configuration Manager is introduced as the main tool to manage services and network protocols. Other system-related configuration that you might want to change is discussed in relation to the operating system (e.g. page file location, optimize system for background services) and SQL Server options (e.g. Max Server Memory, Max Degree of Parallelism).
Included is a useful list of configuration options that you might want to check/change to optimize your SQL Servers. There is a very valid warning related to any changes, please ensure you test changes thoroughly, a change that might generally improve performance may actually be detrimental on your system.
While discussing parallelism, the point is made that the Dynamic Management View (DMV) sys.dm_os_tasks can be used to observe parallelism, however no further information is provided. It may have been more informative to say the DMV contains the column exec_context_id, which shows the different threads for the same process id (spid), a screenshot might have been useful too.
Overall, the chapter provides a gentle introduction to what the book is about and what you can expect in subsequent chapters. There are good links to other chapters.
This is a detailed book by well-known and respected authors. Although the content is deep, it is purposely narrow in range. Just as you don’t need to be a mechanic to drive a car, you don’t need to know low-level SQL Server internals to run code adequately; however, knowing about the internals of SQL Server will not only satisfy your intellectual curiosity, but also provide clues on how to optimize your SQL queries and troubleshoot problems.
As an indication of the depth of the book, here is an extract on indexes: “An index row doesn’t use the TagB orFsize row header values. In place of the Fsize field, which indicates where the fixed-length portion of a row ends, the page header pminlen value is used to decode an index row. The pminlen value indicates the offset at which the fixed-length data portion of the row ends. If the index row has no variable-length or nullable columns, that is the end of the row.”
In some ways, this book seemed less ‘special’ than its previous editions. This is not a fault of the book per se, but more because increasingly SQL Server internal information is being blogged.
Each chapter has a half-page conclusions section, this might have been better as a 2 or 3-page summary.
Often there is little linkage and flow between chapters by different authors, while this has the advantage that some chapters can be read independently, there is a degree of overlap and also less coherence than might have been possible with better editing (e.g. chapters on query execution, query optimizer and plan caching might have been better written by one author). That said, all chapters are individually well written, barring some basic English errors that the editors should have caught (I have submitted a list of around 10 errors to the companion website).
This is a big, heavy, and detailed book, I had to physically tear it into two parts so it was easier to carry and read. My initial notes on the book numbered 30 pages, and several sections required more than one reading.
You can download the first chapter for free, together with a detailed table of contents, from its page on the O'Reilly website:
If you want to know more about SQL Server, how the pages are linked together, the structures involved, and how the optimizer works, I can certainly recommend this book.