Search This Blog

30 May 2007

Book Review: Understanding MySQL Internals.

I actually received this book about a month ago but from necessity, I had to put it to one side and deal with more important issues. It is not a big book, only 235 pages, but it has an easy to read conversational style, unlike similarly titled technical books on the internals of other software.

If you're looking for a book about database theory, this book is not for you. It conveys to the reader a good overview as how MySQL functions without delving into the theories as to how the algorithms work or the rationale behind their design. The book does a good job of at least giving a drive-by look at most of the significant components of MySQL. libmysys, MySQL's platform library which allows MySQL to work on a very wide range of operating systems is mentioned only under the subsection titles 'Core API' and 'Utility API' and only lists about 30 of the functions available: libmysys provides the important glue between MySQL and the operating system, comparable with Netscape's NSPR or Apache's APR. The only omission within this book is information of MySQL's string-handling and character-set functions and data structures.

As the author acknowledged in his introduction, the bleeding-edge of MySQL development does move quite fast - so for a reader to make use of this book, I would recommend using the MySQL 4.1 or 5.0 source code for reference. There are many significant changes within the 5.1 beta source code which are not covered - which is perfectly reasonable as 5.1 is still in beta. I do hope that Sasha Pachev has a "2nd Edition" in the works which will cover 5.1 when it is finally released as stable and the plug-ins infrastructure as that would lie the greatest avenue for users and 3rd party ISVs to develop extensions for MySQL. There are also several exciting new components, such as the Falcon storage engine, which would be worthy of mention and perhaps an overview of their operation.

This book would be valuable to anyone unfamiliar with the MySQL source code and provides a foundation which can be built upon. It is informative and does not dazzle the reader with techo-jargon and theories.

If you're interested in this book, it is published by O'Reilly.
http://www.oreilly.com/catalog/9780596009571/index.html

22 May 2007

Been busy,

I have been very busy this past months, with both personal crisis and mega-patches. This is my MySQL blog so lets keep it to topic.
A couple of weeks ago, the plugins mega-patch was finally pushed and was released to the world in version 5.1.18. Thanks to Ingo and Sergei for keeping up the effort while I was occupied. As part of the code push, InnoDB code was stripped out of the main mysqld code and stored where it belongs, within Innobase's code. This is an exciting development as it now makes it easier than ever for plugin developers to create plugins without having to modify any existing code within mysqld. It has taken many months to get to this point but we are finally there. Anyone remember our CEO announcing the plugin initutive back when Innobase was acquired by Oracle? October 2005, I believe.

Since that push, I am back on bug-fixing... I have an annoying bug on Itanic with Intel's Itanic Compiler. (Yeah, I know the name is Itanium) The ELF fixups required for the embedded library are not being generated correctly because it uses a 22bit word as an offset and the code footprint is more than 4MB. It is quite likely that the fault lies in the version of Binutils used but for some reason, a recent binutils is not supported by the particular license of RedHat AS we have installed there.

On the bright side, I had some encouraging chats with Eric Herman... and after an excitingly short evening of coding, I have developed a PoC of external stored procedures support in mysqld. All that needs to be done now are the actual plugins to support particular types of external procedures - Eric wants to carry the baton for Java... I think I shall play with C. That should prove interesting as it will require using libtcc to create on-the-fly trampoline code so that native C functions can be called.

Something which deserves a minor mention: I have successfully compiled and tested Jim Starkey's Falcon Storage Engine for MySQL on a Quad PowerPC G5 Mac running Mac OS/X 10.4.9.