Constant propagation versus join reordering in Datalog

  • Mariano P. Consens
  • Alberto O. Mendelzon
  • Dimitra Vista
  • Peter T. Wood
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 985)


Constant propagation and join reordering are two standard optimization techniques used for Datalog programs. These techniques have typically been studied independently of one another. However, in order to achieve constant propagation it is sometimes necessary to impose a certain join ordering on a given program. In the worst case this ordering may result in efficiencies which overcome the benefit of constant propagation. Thus the goal of constant propagation should not necessarily be pursued to the exclusion of all else. We study this problem in the context of GraphLog, a visual language whose queries are graphical notations which are translated into Datalog. We study two translation schemes from GraphLog to Datalog, one which always achieves constant propagation and another which does not. We show that each translation can significantly outperform the other. We demonstrate this by both measuring execution times using actual application data, and by providing analytical formulae to explain the trade-off between constant propagation and join reordering.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    F. Bancilhon and R. Ramakrishnan. An Amateur's Introduction to Recursive Query Processing Strategies. In SIGMOD, pages 16–52, 1986.Google Scholar
  2. 2.
    C. Beeri and R. Ramakrishnan. On the Power of Magic. In PODS, pages 269–283, 1987.Google Scholar
  3. 3.
    M.P. Consens. Creating and Filtering Structural Data Visualizations using Hygraph Patterns. PhD thesis, Department of Computer Science, University of Toronto, February 1994. (Available as Technical Report CSRI-302).Google Scholar
  4. 4.
    M.P. Consens, F.Ch. Eigler, M.Z. Hasan, A.O. Mendelzon, E.G. Noik, A.G. Ryman, and D. Vista. Architecture and Applications of the Hy+ Visualization System. IBM Systems Journal, 33(3):458–476, 1994.Google Scholar
  5. 5.
    M.P. Consens and A.O. Mendelzon. GraphLog: A Visual Formalism for Real Life Recursion. In PODS, pages 404–416, 1990.Google Scholar
  6. 6.
    M.P. Consens, A.O. Mendelzon, and A. Ryman. Visualizing and Querying Software Structures. In ICSE '92, pages 138–156, 1992.Google Scholar
  7. 7.
    M.P. Consens, A.O. Mendelzon, and D. Vista. Deductive Database Support for Data Visualization. In EDBT, pages 45–58, 1994.Google Scholar
  8. 8.
    J. Han and H. Lu. Some Performance Results on Recursive Query Processing in Relational Database Systems. In ICDE, pages 533–539, 1986.Google Scholar
  9. 9.
    J.E. Hopcroft and J.D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, 1979.Google Scholar
  10. 10.
    D. Kemp, K. Ramamohanarao, and Z. Somogyi. Right-, Left-, and Multi-Linear Rule Transformations that Maintain Context Information. In VLDB, pages 380–391, 1990.Google Scholar
  11. 11.
    J.F. Naughton, R. Ramakrishnan, Y. Sagiv, and J.D. Ullman. Argument Reduction by Factoring. In VLDB, pages 173–182, 1989.Google Scholar
  12. 12.
    R. Ramakrishnan, D. Srivastava, S. Sudarshan, and P. Seshadri. Implementation of the CORAL Deductive Database System. In SIGMOD, pages 167–176, 1993.Google Scholar
  13. 13.
    D. Vista and P.T. Wood. Efficient Evaluation of Visual Queries Using Deductive Databases. In R. Ramakrishnan, editor, Applications of Logic Databases, pages 143–161. Kluwer Academic Publishers, Boston, 1995.Google Scholar
  14. 14.
    P.T. Wood. Factoring Augmented Regular Chain Programs. In VLDB, pages 255–263, 1990.Google Scholar
  15. 15.
    P.T. Wood. Magic Factoring of Closure Programs. In PODS, pages 174–183, 1995.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Mariano P. Consens
    • 1
  • Alberto O. Mendelzon
    • 2
  • Dimitra Vista
    • 2
  • Peter T. Wood
    • 3
  1. 1.Dep. of Computer ScienceUniv. of WaterlooWaterlooCanada
  2. 2.Computer Systems Research InstituteUniv. of TorontoTorontoCanada
  3. 3.Dep. of Computer ScienceUniv. of Cape TownRondeboschSouth Africa

Personalised recommendations