Optimization of Queries with Conjunction of Predicates
Keywords:
optimal join subplans, cost function, query tree, join optimization algorithm, h-metric, heuristic methodAbstract
A method to optimize the access at the objects of a relational database is through the optimization of the queries. This article presents an approach of the cost model used in optimization of Select-Project-Join (SPJ) queries with conjunction of predicates and proposes a join optimization algorithm named System RO-H (System Rank Ordering Heuristic). The System RO-H algorithm for optimizing SPJ queries with conjunction of predicates is a System R Dynamic Programming algorithm that extends optimal linear join subplans using a rank-ordering heuristic method as follows: choosing a predicate in ascending order according to the h-metric, where the h-metric depends on the selectivity and the cost per tuple of the predicate, using an expression with heuristic constants.
The System Rank-Ordering Heuristic algorithm finds an optimal plan in the space of linear left deep join trees. The System RO-H algorithm saves not a single plan, but multiple optimal plans for every subset, one for each distinct such order, termed interesting order. In order to build an optimal execution plan for a set S of i relations, the optimal plan for each subset of S, consisting of i-1 relations is extended, using the Lemma based on a h-metric for predicates. Optimal plans for subsets are stored and reused. The optimization algorithm chooses a plan of least cost from the execution space.
References
S. Ganguly, W. Hasan, R. Krishnamurthy, Query optimization for parallel execution, In Proceedings of the ACM SIGMOD International Conference on Management of Data SIGMOD, Ed. ACM Press, New York, pp. 9-18, 1992. http://dx.doi.org/10.1145/130283.130291
P. G. Selinger, M. M. Astrahan, R. A. Lorie, T. G. Price, Access path selection in a relational database management system, In Proceedings of ACM SIGMOD International Conference on Management of Data SIGMOD, Boston, MA, ACM Press, New York, pp. 23-34, 1979. http://dx.doi.org/10.1145/582095.582099
D. Chimenti, R. Gamboa, R. Krishnamurthy, Towards an open architecture for LDL, In Proceedings of the 15th International Conference on Very Large Data Bases, VLDB, Netherlands, Ed. Morgan Kaufmann Publishers Inc., San Francisco, CA, pp. 195-203, 1989.
S. Chaudhuri, K. Shim, Query optimization in the presence of foreign functions, In Proceedings of the 19th International Conference on Very Large Data Bases, Ireland, Morgan Kaufmann Publishers Inc., San Francisco, CA, pp. 526-541, 1993.
J. M. Hellerstein, Practical predicate placement, In Proceedings of the ACM SIGMOD International Conference on Management of Data, Minneapolis, ACM Press, New York, pp. 325-335, 1994. http://dx.doi.org/10.1145/191839.191904
J. M. Hellerstein, M. Stonebraker, Predicate migration: Optimizing queries with expensive predicates, In Proceedings of the ACM SIGMOD International Conference on Management of Data, Washington, ACM Press, New York, pp. 267-276, 1993. http://dx.doi.org/10.1145/170035.170078
S. Chaudhuri, K. Shim, Optimization of Queries with User-Defined Predicates, ACM Transactions on Database Systems, Vol. 24, No. 2, pp. 177-228, 1999. http://dx.doi.org/10.1145/320248.320249
J. M. Hellerstein, J. M., M. Stonebraker, Predicate migration: Optimizing queries with expensive predicates, In Proceedings of the ACM SIGMOD International Conference onManagement of Data, Washington, DC, Eds. ACM Press, New York, NY, pp. 267-276, 1993.
R. Krishnamurthy, H. Boral, C. Zaniolo, Optimization of nonrecursive queries, In Proceedings of the 12th International Conference on Very Large Data Bases, Kyoto, Japan, VLDB Endowment, Berkeley, CA, pp. 128-137, 1986.
C. L. Monma, J. Sidney, Sequencing with series-parallel precedence constraints, Math. Oper. Res. 4, pp. 215-224, 1979. http://dx.doi.org/10.1287/moor.4.3.215
K. Y. Whang, R. Krishnamurthy, Query optimization in a memory-resident domain relational calculus database system, ACM Trans. Database Syst. 15, pp. 67-95, 1990. http://dx.doi.org/10.1145/77643.77646
J. M. Hellerstein, M. Stonebraker, Predicate migration: Optimizing queries with expensive predicates, In Proceedings of the ACM SIGMOD Conference, 1993. http://dx.doi.org/10.1145/170035.170078
T. H. Cormen, C. E. Leiserson, R. L. Rivest, Introduction to Algorithms, MIT Press, Cambridge, MA, 1990.
P. G. Selinger, M. M. Astrahan, R. A. Lorie, T. G. Price, Access path selection in a relational database management system, In Proceedings of ACM SIGMOD International Conference on Management of Data, Boston, MA, ACM Press, New York, pp. 23-34, 1979. http://dx.doi.org/10.1145/582095.582099
Y. E. Ioannidis, Y. C. Kang, Randomized algorithms for optimizing large join queries, In Proceedings of the 1990 ACM SIGMOD International Conference on Management of Data, Ed. ACM Press, New York, NY, pp. 312-321, 1990. http://dx.doi.org/10.1145/93597.98740
S. Chaudhuri, K. Shim, Including group-by in query optimization, In Proceedings of the 20th International Conference on Very Large Data Bases, VLDB Endowment, Berkeley, CA, 1994.
L. D. Shapiro, Join processing in database systems with large main memories, ACM Trans. Database Syst. 11, pp. 239-264, 1986. http://dx.doi.org/10.1145/6314.6315
Published
Issue
Section
License
ONLINE OPEN ACCES: Acces to full text of each article and each issue are allowed for free in respect of Attribution-NonCommercial 4.0 International (CC BY-NC 4.0.
You are free to:
-Share: copy and redistribute the material in any medium or format;
-Adapt: remix, transform, and build upon the material.
The licensor cannot revoke these freedoms as long as you follow the license terms.
DISCLAIMER: The author(s) of each article appearing in International Journal of Computers Communications & Control is/are solely responsible for the content thereof; the publication of an article shall not constitute or be deemed to constitute any representation by the Editors or Agora University Press that the data presented therein are original, correct or sufficient to support the conclusions reached or that the experiment design or methodology is adequate.