MySQL Internals Manual

MySQL Internals ManualShort Description
The purpose of this chapter is to establish a set of guidelines that will help you, the developer, to follow the established MySQL coding styles and standards when writing code. Consistent style is important as it makes it easier to maintain our code and allows you to find specific routines much more quickly.

Website: faemalia.net | Filesize: 530kb
No of Page(s): 148

Content
…Bad join choices can cause more damage than bad choices in single-table searches, so MySQL developers have spent proportionally more time making sure that the tables in a query are joined in an optimal order and that optimal access methods (often called “access paths”) are chosen to retrieve table data. A combination of a fixed order in which tables are joined and the corresponding table access methods for each table is called “query execution plan” (QEP). The goal of the query optimizer is to find an optimal QEP among all possible such plans. There are several general ideas behind join optimization.

Each plan (or part of plan) is assigned a “cost.” The cost of a plan reflects roughly the resources needed to compute a query according to the plan, where the main factor is the number of rows Chapter 2: The Optimizer that will be accessed while computing a query. Once we have a way to assign costs to different QEPs we have a way to compare them. Thus, the goal of the optimizer is to find a QEP with minimal cost among all possible plans.
In MySQL, the search for an optimal QEP is performed in a bottom-up manner. The optimizer first considers all plans for one table, then all plans for two tables, and so on, until it builds a complete optimal QEP. Query plans that consist of only some of the tables (and predicates) in a query are called “partial plans.” The optimizer relies on the fact that the more tables are added to a partial plan, the greater its cost. This allows the optimizer to expand with more tables only the partial plans with lower cost than the current best complete plan.

Get the file Download here

AddThis Social Bookmark Button
Related Books:
  • Introduction to MySQL
  • Fixing MySQL after upgrading to Mac OS X 10.2
  • MySQL PHP Tutorial
  • MySQL GUI Tools Manual
  • Chapter 3. MySQL Tutorial
  • MySQL 5.0 Triggers MySQL 5.0 New Features Series Part 2
  • MySQL 3.23, 4.0, 4.1 Reference Manual
  • Tutorial for MySQL An Introduction to Java Programming

  • Related Searches: , , , ,



    Comments

    Leave a Reply