This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Optimization and Evaluation of Disjunctive Queries
March/April 2000 (vol. 12 no. 2)
pp. 238-260

Abstract—It is striking that the optimization of disjunctive queries—i.e., those which contain at least one or-connective in the query predicate—has been vastly neglected in the literature, as well as in commercial systems. In this paper, we propose a novel technique, called bypass processing, for evaluating such disjunctive queries. The bypass processing technique is based on new selection and join operators that produce two output streams: the true-stream with tuples satisfying the selection (join) predicate and the false-stream with tuples not satisfying the corresponding predicate. Splitting the tuple streams in this way enables us to “bypass” costly predicates whenever the “fate” of the corresponding tuple (stream) can be determined without evaluating this predicate. In the paper, we show how to systematically generate bypass evaluation plans utilizing a bottom-up building block approach. We show that our evaluation technique allows to incorporate the standard SQL semantics of null values. For this, we devise two different approaches: One is based on explicitly incorporating three-valued logic into the evaluation plans; the other one relies on two-valued logic by “moving” all negations to atomic conditions of the selection predicate. We describe how to extend an iterator-based query engine to support bypass evaluation with little extra overhead. This query engine was used to quantitatively evaluate the bypass evaluation plans against the traditional evaluation techniques utilizing a CNF- or DNF-based query predicate.

[1] A. Kemper, G. Moerkotte, K. Peithner, and M. Steinbrunn, “Optimizing Disjunctive Queries with Expensive Predicates,” Proc. ACM SIGMOD Conf. Management of Data, pp. 336-347, May 1994.
[2] M. Steinbrunn, K. Peithner, G. Moerkotte, and A. Kemper, “Bypassing Joins in Disjunctive Queries,” Proc. Conf. Very Large Data Bases (VLDB), pp. 228-238, Sept. 1995.
[3] Query Processing for Advanced Database Systems, J.C. Freytag, D. Maier, G. Vossen, eds. San Mateo, Calif.: Morgan Kaufmann, 1993.
[4] J.C. Freytag, “A Rule-Based View of Query Optimization,” Proc. ACM SIGMOD Conf. Management of Data, pp. 173-180, May 1987.
[5] G. Graefe and D. DeWitt, “The Exodus Optimizer Generator,” Proc. ACM SIGMOD, 1987.
[6] G. Lohman, “Grammar-Like Functional Rules for Representing Query Optimization Alternatives,” Proc. ACM SIGMOD Conf. Management of Data, pp. 18-27, May 1988.
[7] D.D. Straube and M.T. Ozsu, “Queries and Query Processing in Object-Oriented Database Systems,” ACM Trans. Information Systems, vol. 8, no. 4, 1990.
[8] A. Kemper and G. Moerkotte, “Advanced Query Processing in Object Bases Using Access Support Relations,” Proc. Conf. Very Large Data Bases (VLDB), pp. 290-301, Aug. 1990.
[9] S. Cluet and C. Delobel, “A General Framework for the Optimization of Object-Oriented Queries,” Proc. ACM SIGMOD Conf., pp. 383–392, June 1992.
[10] D.S. Batory, “Extensible Cost Models and Query Optimization in GENESIS,” IEEE Database Eng., vol. 9, Dec. 1986.
[11] J.A. Blakeley, W.J. McKenna, and G. Graefe, “Experiences Building the Open OODB Query Optimizer,” Proc. ACM SIGMOD Conf. Management of Data, pp. 287-295, May 1993.
[12] G. Graefe and W. McKenna, “The Volcano Optimizer Generator: Extensibility and Efficient Search,” Proc. IEEE Conf. Data Eng., pp. 209-218, Apr. 1993.
[13] L.M. Haas,W.F. Cody,J.C. Freytag,G. Lapis,B.G. Lindsay,G.M. Lohman,K. Ono,, and H. Pirahesh,“Extensible query processing in Starburst,” Proc. ACM SIGMOD Int’l Conf. Management of Data, pp. 377-388, 1989.
[14] L. Becker and R.H. Güting, “Rule-Based Optimization and Query Processing in an Extensible Geometric Database System,” ACM Trans. Database Systems, vol. 17, pp. 247-303, June 1992.
[15] G. Mitchell, U. Dayal, and S.B. Zdonik, “Control of an Extensible Query Optimizer: A Planning-Based Approach,” Proc. Conf. Very Large Databases (VLDB), pp. 517-528, Aug. 1993.
[16] A. Kemper, G. Moerkotte, and K. Peithner, “A Blackboard Architecture for Query Optimization in Object Bases,” Proc. Conf. Very Large Databases (VLDB), pp. 543-554, Aug. 1993.
[17] A.Y. Levy, I.S. Mumick, and Y. Sagiv, “Query Optimization by Predicate Move-Around,” Proc. 20th VLDB Conf., 1994.
[18] J.M. Hellerstein, “Predicate Migration: Optimizing Queries with Expensive Predicates,” Proc. ACM SIGMOD Conf., pp. 267-276, 1993.
[19] C. Monma and J. Sidney, “Sequencing with Series-Parallel Precedence Constraints,” Math. Operations Research, vol. 4, pp. 215-224, 1979.
[20] S. Chaudhuri and K. Shim, “Optimization of Queries with User-Defined Predicates,” Proc. Conf. Very Large Data Bases (VLDB), pp. 87-98, Sept. 1996.
[21] M. Muralikrishna, “Optimization of Multiple-Disjunct Queries in a Relational Database System,” Technical Report no. 750, Univ. of Wisconsin-Madison, Feb. 1988.
[22] F. Bry, “Towards an Efficient Evaluation of General Queries: Quantifier and Disjunction Processing Revisited,” Proc. ACM SIGMOD Conf. Management of Data, pp. 193-204, May 1989.
[23] P. Selinger,D. Astrahan,D. Chamberlin,R. Lorie,, and T. Price,“Access path selection in a relational database management system,” Proc. 1979 ACM-SIGMOD Int’l Conf. Management of Data, pp. 23-34,Boston, May 1979.
[24] P.A. Bernstein, N. Goodman, E. Wong, C. Reeve, and J.B. Rothnie, “Query Processing in a System for Distributed Databases,” ACM Trans. Database Systems, vol. 6, no. 4, pp. 602-625, Dec. 1981.
[25] L. Kerschberg, P.D. Ting, and S.B. Yao, “Query Optimization in a Star Computer Network,” ACM Trans. Database Systems, vol. 7, pp. 678-711, Dec. 1982.
[26] M. Jarke and J. Koch, “Query Optimization in Database Systems,” ACM Computer Surveys, vol. 16, pp. 111–152, 1984.
[27] M. Steinbrunn, “Heuristic and Randomised Optimisation Techniques in Object-Oriented Database Systems,” Ringstraße 32, 53757 St. Augustin, Germany: infix-Verlag, dissertation, Universität Passau, 1996.
[28] K. Peithner, “Optimierung deklarativer Anfragen in Objektbanken,” PhD thesis, Ringstr. 32, 53757 Sankt Augustin, Germany, dissertation, Universität Passau, 1996.
[29] R.G.G. Cattell, D.K. Barry et al. , Object Database Standard—ODMG 2.0. Morgan Kaufmann, 1997.
[30] J.M. Hellerstein and J.F. Naughton, “Query Execution Techniques for Caching Expensive Methods,” Proc. ACM SIGMOD Conf., 1996.
[31] D. Stemple and T. Sheard, “A Recursive Base for Database Programming Primitives,” Proc. Kiev East/West Workshop Next Generation Database Technology, Apr. 1991.
[32] M.Z. Hanani, “An Optimal Evaluation of Boolean Expressions in an Online Query System,” Comm. ACM, vol. 20, pp. 344-347, May 1977.
[33] G. von Bültzingsloewen, SQL-Anfragen-Optimierung für parallele Bearbeitung. New York, Berlin, etc.: FZI-Berichte Informatik, Springer-Verlag, 1991.
[34] G. Graefe, "Query Evaluation Techniques for Large Databases," ACM Computing Surveys, vol. 25, no. 2, pp. 73-170, June 1993.
[35] B. Stroustrup,The C++ Programming Language. Reading MA: Addison-Wesley, 1991, 2nd ed.
[36] C.A. Gerlhof, “Optimierung von Speicherzugriffskosten in Objektbanken: Clustering und Prefetching,” PhD thesis, Universität Passau, Fakultät für Mathematik und Informatik, D-94030 Passau, dissertation, Universität Passau, 1996.

Index Terms:
Query optimization, query processing, disjunctive queries, query evaluation plans, expensive query predicates, bypass processing.
Citation:
Jens Claussen, Alfons Kemper, Guido Moerkotte, Klaus Peithner, Michael Steinbrunn, "Optimization and Evaluation of Disjunctive Queries," IEEE Transactions on Knowledge and Data Engineering, vol. 12, no. 2, pp. 238-260, March-April 2000, doi:10.1109/69.842265
Usage of this product signifies your acceptance of the Terms of Use.