Expert MySQL pp 495-541 | Cite as

Query Optimization

  • Charles Bell


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.


Source Code Database System Query Optimization Query Execution Recursive Method 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    P. G. Selinger, M. M. Astraham, D. D. Chamberlin, R. A. Lories, and T. G. Price. 1979. “Access Path Selection in a Relational Database Management System”. Proceedings of the ACM SIGMOD International Conference on the Management of Data, Aberdeen, Scotland: 23–34. Considered by some to be the “Bible of Query Optimization.”Google Scholar
  2. 2.
    M. Stonebraker, E. Wong, P. Kreps. 1976. “The Design and Implementation of INGRES.” ACM Transactions on Database Systems 1(3): 189–222.CrossRefGoogle Scholar
  3. 7.
    D. Kossman and K. Stocker. 2000. “Iterative Dynamic Programming: A New Class of Query Optimization Algorithms.” ACM Transactions on Database Systems 25(1): 43–82.CrossRefGoogle Scholar
  4. 8.
    Y. E. Ioannidis, R. T. Ng, K. Shim, and T. Sellis. 1997. “Parametric Query Optimization.” VLDB Journal 6:132–151.CrossRefGoogle Scholar
  5. 12.
    C. Lee, C. Shih, and Y. Chen. 2001. “A Graph-Theoretic Model for Optimizing Queries Involving Methods.” VLDB Journal 9:327–343.Google Scholar

Copyright information

© Charles Bell 2012

Authors and Affiliations

  • Charles Bell

There are no affiliations available

Personalised recommendations