Skip to main content

2012 | Buch | 2. Auflage

Expert MySQL

insite
SUCHEN

Über dieses Buch

Expert MySQL is the leading reference for learning, understanding, and extending the MySQL server. It unlocks the full promise of open source by showing how to modify the code, create your own storage engine, build your own authentication plugins, and even add your own functions and commands to the SQL language. No other book provides the level of detail or the extensive examples of the inner workings of MySQL that have taken engineers years to master. Expert MySQL is a must have book for all systems integrators, engineers, and software developers working with the MySQL server code.

Expert MySQL is also a wealth of information on key aspects of MySQL internals. You’ll learn about internal query representation, how the optimizer creates execution plans, and how to exert control over those plans for optimal performance in your environment. You'll even learn to build your own query optimizer, giving insight that can help you understand and resolve tough performance problems. High-availability and replication are also covered, making Expert MySQL a must-have book for anyone doing high-end work involving MySQL.

Shows how to customize MySQL and its storage and authentication engines Provides in-depth knowledge of internals for use in query tuning and performance troubleshooting Covers high-end features such as high-availability and replication

Inhaltsverzeichnis

Frontmatter

Getting Started with MySQL Development

Frontmatter
Chapter 1. MySQL and The Open Source Revolution
Abstract
Open source systems are rapidly changing the software landscape. Information technology professionals everywhere are taking note of the high quality, and in many cases world-class, development and support offered by open-sourcesoftware vendors. Corporations are paying attention, because for the first time they have an alternative to commercial proprietary software vendors. Small businesses are paying attention because open source software can significantly lower the cost of their information systems. Individuals are paying attention because they have more choices with more options than ever before. The majority of the underpinnings that make the Internet what it is today are based on open source software systems, such as Linux, Apache HTTP server, BIND, Sendmail, OpenSSL, MySQL, and many others.
Charles Bell
Chapter 2. The Anatomy of a Database System
Abstract
While you may know the basics of a relational database management system (RDBMS) and be an expert at administering the system, you may have never explored the inner workings of a database system. Most of us have been trained on and have experience with managing database systems, but neither academic nor professional training includes much about the way database systems are constructed. A database professional may never need this knowledge, but it is good to know how the system works so that you can understand how best to optimize your server and even how best to utilize its features.
Charles Bell
Chapter 3. A Tour of the MySQL Source Code
Abstract
This chapter presents a complete introduction to the MySQL source, along with an explanation of how to obtain and build the system. I introduce you to the mechanics of the source code as well as coding guidelines and best practices for how to maintain the code. I focus on the parts of the code that deal with processing queries; this will set the stage for topics introduced in Chapter 11 and beyond. I also give you a short overview of the plugin system for dynamically loading libraries containing features.
Charles Bell
Chapter 4. Test-Driven MySQL Development
Abstract
Systems integrators must overcome the limitations of the systems they are integrating, but sometimes a system lacks certain functions or commands that are needed for the integration. Oracle recognizes this and includes flexible options in the MySQL server that add new functions and commands. This chapter introduces a key element in generating high-quality extensions to the MySQL system. I discuss software testing and explain some common practices for testing large systems, using specific examples to illustrate the accepted practices of testing the MySQL system.
Charles Bell

Extending MySQL

Frontmatter
Chapter 5. Debugging
Abstract
This chapter discusses one of the most powerful tools any developer can wield: debugging. Good debugging skills help ensure that your software projects are easy to develop and less prone to failure. I’ll also explore the most common techniques for debugging the MySQL system. If you have already developed solid debugging skills, feel free to skim the following sections and move on to the section “Debugging MySQL.”
Charles Bell
Chapter 6. Embedded MySQL
Abstract
The MySQL server is well known for its lightweight and high-performance features, but did you know it can also be used as an embedded database for your enterprise applications? This chapter explains the concepts of embedded applications and how to use the MySQL C API for creating your own embedded MySQL applications. I’ll introduce you to the techniques for compiling the embedded server and writing applications for both Linux and Windows.
Charles Bell
Chapter 7. Adding Functions and Commands to MySQL
Abstract
One of the greatest challenges facing systems integrators is overcoming the limitations of the systems being integrated. This is usually a result of the system having limitations with, or not having certain functions or commands that are needed for, the integration. Often, this means getting around the problem by creating more “glue” programs to translate or augment existing functions and commands.
Charles Bell
Chapter 8. Extending MySQL High Availability
Abstract
One advanced feature of MySQL is its ability to provide high-availability database solutions. The server component responsible for obtaining high availability is replication. Some would include other features, such as partitioning and a host of smaller features, but the most important feature that enables high availability is replication.
Charles Bell
Chapter 9. Developing MySQL Plugins
Abstract
During our tour of the MySQL source code and architecture in Chapter 3, we touched on a special feature of MySQL called plugins. MySQL plugins are specially designed dynamic libraries that allow you to add new functionality to the server without taking the server offline. There are several forms of plugins supported today, but as the server continues to evolve, expect to see more features offered using this architecture.
Charles Bell
Chapter 10. Building Your Own Storage Engine
Abstract
The MySQL pluggable architecture that enables the use of multiple storage engines is one of the most important features of the MySQL system. Many database professionals have refined advanced skills for tuning the logical structure of relational database systems to meet the needs of the data and their applications. With MySQL, database professionals can also tune the physical layer of their database systems by choosing the storage method that best optimizes the access methods for the database. That is a huge advantage over relational database systems that use only a single storage mechanism.
Charles Bell

Advanced Database Internals

Frontmatter
Chapter 11. Database System Internals
Abstract
This chapter presents some database-system internals concepts in preparation for studying database-system internals at a deeper level. I present more in-depth coverage of how queries are represented internally within the server and how queries are executed. I explore these topics from a more general viewpoint and then close the chapter with a discussion of how you can use the MySQL system to conduct your own experiments with the MySQL system internals. Last, I’ll introduce the database system’s internals experiment project.
Charles Bell
Chapter 12. Internal Query Representation
Abstract
This chapter presents the first part of the advanced database technologies for the database-experiment project (DBXP). I begin by introducing the concept of the query tree structure, which is used for storing a query in memory. Next, I’ll present the query tree structure used for the project along with the first in a series of short projects for implementing the DBXP code. The chapter concludes with a set of exercises you can use to learn more about MySQL and query trees.
Charles Bell
Chapter 13. Query Optimization
Abstract
The query-tree class shown in Chapter 12 forms the starting point for building the experimental-query optimization and execution engine for DBXP. In this chapter, I show you how to add the optimizer to the query-tree class. I begin by explaining the rationale for the heuristics (or rules) used in the optimizer and then jump into writing the code. Because the code for some of the functions is quite lengthy, the examples in this chapter are excerpts. If you are following along by coding the examples, download the source code for this chapter instead of typing in the code from scratch.
Charles Bell
Chapter 14. Query Execution
Abstract
The query-tree class shown in Chapter 12 and the heuristic optimizer shown in Chapter 13 form the first two of the three components that make up the DBXP query-execution engine. In this chapter, I show you how to expand the query-tree class to process project, restrict, and join operations. This will give you a glimpse into the world of database-query execution. I begin by briefly explaining the basic principles of the query execution algorithms and then jump into writing the code. Because the code for some of the methods is quite lengthy, not all of the code examples shown in this chapter include the complete source code. If you are following along by coding the examples, consider loading the source code for this chapter and using it rather than typing in the code from scratch.
Charles Bell
Backmatter
Metadaten
Titel
Expert MySQL
verfasst von
Charles Bell
Copyright-Jahr
2012
Verlag
Apress
Electronic ISBN
978-1-4302-4660-2
Print ISBN
978-1-4302-4659-6
DOI
https://doi.org/10.1007/978-1-4302-4660-2