Abstract
Numerous structures for database query optimizers have been proposed. Many of those proposals aimed at automating the construction of query optimizers from some kind of specification of optimizer behavior. These specification frameworks do a good job of partitioning and modularizing the kinds of information needed to generate a query optimizer. Most of them represent at least part of this information in a rule-like form. Nevertheless, large portions of these specifications still take a procedural form.
The contributions of this work are threefold. We present a language for specifying optimizers that captures a larger portion of the necessary information in a declarative manner. This language is in turn based on a model of query rewriting where query expressions carry annotations that are propagated during query transformation and planning. This framework is reminiscent of inherited and synthesized attributes for attribute grammars, and we believe it is expressive of a wide range of information: logical and physical properties, both desired and delivered, cost estimates, optimization contexts, and control strategies. Finally, we present a mechanism for processing optimizer specifications that is based on compile-time reflection. This mechanism proves to be succinct and flexible, allowing modifications of the specification syntax, incorporation of new capabilities into generated optimizers, and retargeting the translation to a variety of optimization frameworks.
We report on an implementation of our ideas using the CRML reflective functional language and on optimizer specifications we have written for several query algebras.
Preview
Unable to display preview. Download preview PDF.
References
J. Blakeley, W. McKenna, and G. Graefe. Experiences Building the Open OODB Query Optimizer. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Washington, D.C., pp 287–296, May 1993.
J. C. Freytag and N. Goodman. Translating Aggregate Queries into Iterative Programs. In Proceedings of the Twelfth International Conference on Very Large Databases, Kyoto, Japan, pp 138–146, August 1986.
J. C. Freytag. A Rule-Based View of Query Optimization. Proceedings of the ACM-SIGMOD International Conference on Management of Data, San Francisco, California, pp 173–180, December 1987.
G. Graefe and D. J. DeWitt. The EXODUS Optimizer Generator. In Proceedngs of the ACM-SIGMOD International Conference on Management of Data, San Francisco, California, pp 160–171, December 1987.
G. Graefe and W. McKenna. The Volcano Optimizer Generator: Extensibility and Efficient Search. IEEE Conference on Data Engineering, Vienna, Austria, 1993.
A. Kemper and G. Moerskotte. Advanced Query Processing in Object Bases Using Access Support Relations. In Proceedings of the Sixteenth International Conference on Very Large Databases, Brisbane, Australia, pp 290–301. Morgan Kaufmann Publishers, Inc., August 1990.
D. Knuth. Semantics of Context-free Languages. Mathematical Systems Theory, 2(2):127–145, June 1968.
G. M. Lohman. Grammar-like Functional Rules for Representing Query Optimization Alternatives. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Chicago, Illinois, 13(3):18–27, September 1988.
R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. The MIT Press, Cambridge, Massachusetts, 1990.
G. Mitchell, U. Dayal, and S. B. Zdonik. Control of an Extensible Query Optimizer: A Planning-Based Approach. In Proceedings of the 19th VLDB Conference, August 1993. To appear.
G. Selinger, M. Astrahan, D. Chamberlin, R. Lorie, and T. Price. Access Path Selection in a Relational Database Management System. Proceedings of the ACM-SIGMOD International Conference on Management of Data, Boston, Massachusetts, pp 23–34, May 1979.
T. Sheard. Guide to using CRML: Compile-Time Reflective ML. Unpublished manuscript, Oregon Graduate Institute, March 1993.
R. Wilhelm. Tree Transformations, Functional Languages, and Attribute Grammars. Proceedings of the International Workshop on Attribute Grammars and their Applications, Paris, France, pp 116–129, September 1990. LNCS 461.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Fegaras, L., Maier, D., Sheard, T. (1993). Specifying rule-based query optimizers in a reflective framework. In: Ceri, S., Tanaka, K., Tsur, S. (eds) Deductive and Object-Oriented Databases. DOOD 1993. Lecture Notes in Computer Science, vol 760. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57530-8_9
Download citation
DOI: https://doi.org/10.1007/3-540-57530-8_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57530-6
Online ISBN: 978-3-540-48212-3
eBook Packages: Springer Book Archive