A Semantic Query Optimization Approach to Optimize Linear Datalog Programs

  • José R. Paramá
  • Nieves R. Brisaboa
  • Miguel R. Penabad
  • Ángeles S. Places
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2435)


After two decades of research in Deductive Databases, SQL99 brings deductive databases again to the foreground given that SQL99 in- cludes queries with linear recursion. However, the execution of recursive queries may result in slow response time, thus the research in query op- timization is very important to provide the suitable algorithms that will be included in the query optimizers of the database management systems in order to speed up the execution of recursive queries. We use a seman- tic query optimization approach in order to improve the efficiency of the evaluation of datalog programs. Our main contribution is an algorithm that builds a program P’ equivalent to a given program P, when both are applied over a database d satisfying a set of functional dependencies. The input program P is a linear recursive datalog program. The new program P’ has less number of different variables and, sometimes, less number of atoms in the recursive rules, thus it is cheaper to evaluate.


Cyclic Variable Query Optimization Conjunctive Query Expansion Graph Deductive Database 
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.
    S. Abiteboul, R. Hull, and V. Vianu. Foundations of Databases. Addison Wesley, 1995.Google Scholar
  2. 2.
    A.V. Aho, C. Beeri, and J.D. Ullman. The theory of joins in relational databases. ACM TODS, 4(3):297–314, 1979.CrossRefGoogle Scholar
  3. 3.
    N.R. Brisaboa, A. Gonzalez-Tuchmann, H.J. Hernández, and J.R. Paramá. Chasing programs in datalog. In Proceedings of the 6th International Workshop on Deductive Databases and Logic Programming DDLP’98 pages 13–23. GMD-Forsch ngzentrum Informationstechnik GmbH 1998 (GMD Report 22), 1998.Google Scholar
  4. 4.
    U.S. Chakravarthy, J. Grant, and J. Minker. Foundations of semantic query optimization for deductive databases. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 243–273. Morgan Kauffmann Publishers, 1988.Google Scholar
  5. 5.
    S.S. Cosmadakis and P.C. Kanellakis. Parallel evaluation of recursive rule queries. In Proc. Fifth ACM SIGACT-SIGMOD Symposium on Principle of Database Systems pages 280–293, 1986.Google Scholar
  6. 6.
    H. Gaifman, H.G. Mairson, Y. Sagiv, and M.Y. Vardi. Undecidable optimization problems for database logic programs. In Proc. 2nd IEEE Symp. on Logic in Computer Science, pages 106–115, 1987.Google Scholar
  7. 7.
    L.V.S. Lakshmanan and H.J.Hernández. Structural query optimization—a uniform framework for semantic query optimization in deductive databases. In Proc. Tenth ACM SIGACT-SIGMOD-SIGART Symposium on Principle of Database Systems pages 102–114, 1991.Google Scholar
  8. 8.
    D. Maier. The Theory of Relational Databases. Computer Science Press, 1983.Google Scholar
  9. 9.
    J. Melton and A.R. Simon. SQL:1999 Understanding Relational Language Components Morgan Kaufmann, 2002.Google Scholar
  10. 10.
    J. Naughton. Data independent recursion in deductive databases. In Proc. Fifth ACM SIGACT-SIGMOD Symposium on Principle of Database Systems pages 267–279, 1986.Google Scholar
  11. 11.
    Y. Papakonstantinou and V. Vassalos. Query rewriting for semistructured data. In SIGMOD 1999, Proceedings ACM SIGMOD International Conference on Management of Data pages 455–466, 1999.Google Scholar
  12. 12.
    L. Popa, A. Deutsch, A. Sahuguet, and V. Tannen. A chase too far. In SIGMOD pages 273–284, 2000.Google Scholar
  13. 13.
    Y. Sagiv. Optimizing datalog programs. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming chapter 17, pages 659–698. Morgan Kauffmann Publishers, 1987.Google Scholar
  14. 14.
    D. Tang. Linearization-Based Query Optimization in Datalog. PhD thesis, New Mexico State University, Las Cruces, New Mexico, 1997.Google Scholar
  15. 15.
    J.D. Ullman. Principles of Database And Knowledge-Base Systems volme1. Computer Science Press, 1988.Google Scholar
  16. 16.
    M.Y. Vardi. Decidability and undecidability results for boundedness of linear recursive queries. In Proc. Seventh ACM SIGACT-SIGMOD Symposium on Principle of Database Systems, pages 341–351, 1988.Google Scholar
  17. 17.
    K. Wang and L.Y. Yuan. Preservation of integrity constraints in definite datalog programs. Information Processing Letters 44(4), 1992.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • José R. Paramá
    • 1
  • Nieves R. Brisaboa
    • 1
  • Miguel R. Penabad
    • 1
  • Ángeles S. Places
    • 1
  1. 1.Database Lab.Computer Sciende Dept.Universidade da Coruña, Campus de Elviña s/nCoruñaSpain

Personalised recommendations