Understanding MySQL Internals: Discovering and Improving a Great Database

Understanding MySQL Internals: Discovering and Improving a Great Database

by Sasha Pachev
Understanding MySQL Internals: Discovering and Improving a Great Database

Understanding MySQL Internals: Discovering and Improving a Great Database

by Sasha Pachev

eBook

$29.99  $39.99 Save 25% Current price is $29.99, Original price is $39.99. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Although MySQL's source code is open in the sense of being publicly available, it's essentially closed to you if you don't understand it. In this book, Sasha Pachev -- a former member of the MySQL Development Team -- provides a comprehensive tour of MySQL 5 that shows you how to figure out the inner workings of this powerful database. You'll go right to heart of the database to learn how data structures and convenience functions operate, how to add new storage engines and configuration options, and much more.



The core of Understanding MySQL Internals begins with an Architecture Overview that provides a brief introduction of how the different components of MySQL work together. You then learn the steps for setting up a working compilable copy of the code that you can change and test at your pleasure. Other sections of the book cover:



  • Core server classes, structures, and API
  • The communication protocol between the client and the server
  • Configuration variables, the controls of the server; includes a tutorial on how to add your own
  • Thread-based request handling -- understanding threads and how they are used in MySQL
  • An overview of MySQL storage engines
  • The storage engine interface for integrating third-party storage engines
  • The table lock manager
  • The parser and optimizer for improving MySQL's performance
  • Integrating a transactional storage engine into MySQL
  • The internals of replication




Understanding MySQL Internals provides unprecedented opportunities for developers, DBAs, database application programmers, IT departments, software vendors, and computer science students to learn about the inner workings of this enterprise-proven database. With this book, you will soon reach a new level of comprehension regarding database development that will enable you to accomplish your goals. It's your guide to discovering and improving a great database.


Product Details

ISBN-13: 9780596552800
Publisher: O'Reilly Media, Incorporated
Publication date: 04/10/2007
Sold by: Barnes & Noble
Format: eBook
Pages: 258
File size: 2 MB

About the Author

Sasha Pachev graduated from the Brigham Young Universityin 1998 with a degree in Computer Science, worked on the MySQL development team in 2000-2002, and was the original developer of replication in MySQL. In 2003 he wrote his first book MySQL Enterprise Solutions. He currently lives in Provo, Utah with his wife Sarah and his five children working as an independent consultant with the emphasis on
MySQL.



In spite of his great interest in computers, Sasha is equally passionate about distance running. He has won a number of marathons, has a personal best of 2:24:47, and is attempting to qualify for the US Olympic Trials. He feels it is important to help other runners reach their potential, and operates a web site http://FastRunningBlog.Com dedicated to that purpose.

Table of Contents


Preface     xi
MySQL History and Architecture     1
MySQL History     1
MySQL Architecture     4
Nuts and Bolts of Working with the MySQL Source Code     19
Unix Shell     19
BitKeeper     19
Preparing the System to Build MySQL from BitKeeper Tree     22
Building MySQL from BitKeeper Tree     24
Building from Source Distribution     25
Installing MySQL into a System Directory     26
Source Code Directory Layout     27
Preparing the System to Run MySQL in a Debugger     28
Debugger-Guided Source Tour     29
Basics of Working with gdb     30
Finding Things in the Source     33
Interesting Breakpoints and Variables     34
Making a Source Modification     36
Coding Guidelines     37
Keeping Your BitKeeper Repository Up to Date     39
Submitting a Patch     40
Core Classes, Structures, Variables, and APIs     41
THD     41
Net     46
Table     48
Field     51
Utility API Calls     54
Preprocessor Macros     57
GlobalVariables     59
Client/Server Communication     62
Protocol Overview     62
Packet Format     62
Relationship Between MySQL Protocol and OS Layer     63
Authenticating Handshake     64
Command Packet     69
Server Responses     74
Configuration Variables     80
Configuration Variables Tutorial     80
Interesting Aspects of Specific Configuration Variables     88
Thread-Based Request Handling     107
Threads Versus Processes     107
Implementation of Request Handling     109
Thread Programming Issues     113
The Storage Engine Interface     119
The handler Class     120
Adding a Custom Storage Engine to MySQL     136
Concurrent Access and Locking     161
Table Lock Manager     162
Parser and Optimizer     167
Parser     167
Optimizer     170
Storage Engines     194
Shared Aspects of Architecture     195
InnoDB     202
Memory (Heap)     204
MyISAM Merge     205
NDB     205
Archive      206
Federated     207
Transactions     208
Overview of Transactional Storage Engine Implementation     208
Implementing the handler Subclass     209
Defining the handlerton     212
Working with the Query Cache     213
Working with the Replication Binary Log     214
Avoiding Deadlocks     214
Replication     216
Overview     216
Statement-Based Versus Row-Based Replication     217
Two-Threaded Slave     218
Multi-Master     219
SQL Commands to Help Understand Replication     220
Binary Log Format     223
Creating a Custom Replication Utility     227
Index     229
From the B&N Reads Blog

Customer Reviews