Skip to main content

Low complexity aggregation in graphlog and Datalog

  • Logic And Databases
  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 470))

Abstract

We present facilities for computing aggregate functions over sets of tuples and along paths in a database graph.

We show how Datalog can be extended to compute a large class of queries with aggregates without incurring the large expense of a language with general set manipulation capabilities. In particular, we aim for queries that can be executed efficiently in parallel, using the class nc and its various subclasses as formal models of low parallel complexity.

Our approach retains the standard relational notion of relations as sets of tuples, not requiring the introduction of multisets. For the case where no rules are recursive, the language is exactly as expressive as Klug's first order language with aggregates. We show that this class of non-recursive programs cannot express transitive closure (unless logspace=nlogspace), thus providing evidence for a widely believed but never proven folk result. We also study the expressive power and complexity of languages that support aggregation over recursion.

We then describe how these facilities, as well as manipulating the length of paths in database graphs, are incorporated into our visual query language GraphLog. While GraphLog could easily be extended to handle all the queries described above, we prefer to restrict the language in a natural way to avoid explicit recursion; all recursion is expressed as transitive closure. We show that this guarantees all expressible queries are in nc. We analyze other proposals and show that they can express queries that are logspace-complete for p and thus unlikely to be parallelizable efficiently.

This work has been supported by the Information Technology Research Centre of Ontario and the Natural Science and Engineering Research Council of Canada. The first author was also supported by the PEDECIBA — United Nations Program for the Development of Basic Sciences, Uruguay.

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Serge Abiteboul and Catriel Beeri. On the power of languages for the manipulation of complex objects. Technical Report 846, INRIA, May 1988.

    Google Scholar 

  2. R. Agrawal, S. Dar, and H.V. Jagadish. On transitive closure problems involving path computations. Technical report, AT&T Bell Laboratories, 1988.

    Google Scholar 

  3. R. Agrawal. Alpha: an extension of relational algebra to express a class of recursive queries. In Proc. IEEE 3rd. International Conference on Data Engineering, pages 580–590, 1987.

    Google Scholar 

  4. Mariano Consens and Alberto Mendelzon. Expressing structural hypertext queries in GraphLog. In Proceedings of the Second ACM Hypertext Conference, pages 269–292, 1989.

    Google Scholar 

  5. Mariano Consens and Alberto Mendelzon. The G+/GraphLog visual query system. In Proceedings of the ACM-SIGMOD 1990 Annual Conference on Management of Data, page 388, 1990. Video presentation summary.

    Google Scholar 

  6. Mariano Consens and Alberto Mendelzon. GraphLog: a visual formalism for real life recursion. In Proceedings of the Ninth ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, pages 404–416, 1990.

    Google Scholar 

  7. I.F. Cruz, A.O. Mendelzon, and P.T. Wood. G+: Recursive queries without recursion. In Proceedings of the Second International Conference on Expert Database Systems, pages 355–368, 1988.

    Google Scholar 

  8. Isabel Cruz and Theodore Norvell. Aggregative closure: An extension of transitive closure. In Proc. IEEE 5th International Conference on Data Engineering, pages 384–391, 1989.

    Google Scholar 

  9. Mariano P. Consens. Graphlog: “real life” recursive queries using graphs. Master's thesis, Department of Computer Science, University of Toronto, 1989.

    Google Scholar 

  10. Eric C. Cooper. On the expressive power of query languages for relational databases. Technical Report TR-14-80, Aiken Computation Lab., Harvard University, 1980.

    Google Scholar 

  11. Stephen A. Cook. A taxonomy of problems with fast parallel algorithms. Information and Control, 64(1–3):2–22, 1985.

    Article  Google Scholar 

  12. Isabel Cruz. G+: A graphical system for recursive queries. Master's thesis, Dept. of Computer Science, University of Toronto, 1987.

    Google Scholar 

  13. U. Dayal and J.M. Smith. Probe: A knowledge-oriented database management system. In Michel L. Brodie and John Mylopoulos, editors, On knowledge base management systems, pages 227–257. Springer-Verlag, 1986.

    Google Scholar 

  14. M.R. Garey and D.S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Co., New York, 1979.

    Google Scholar 

  15. Marc Gyssens, Jan Paredaens, and Dirk Van Gucht. A graph-oriented object database model. In Proceedings of the Ninth ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, pages 417–424, 1990.

    Google Scholar 

  16. Neil Immerman. Languages that capture complexity classes. SIAM Journal on Computing, 16(4):760–778, 1987.

    Google Scholar 

  17. Neil Immerman. Expressibility and parallel complexity. Technical report, Department of Computer Science, Yale University, 1988.

    Google Scholar 

  18. Y.E. Ioannidis and R. Ramakrishnan. Efficient transitive closure algorithms. Technical Report 765, Computer Sciences, Univ. of Wisconsin-Madison, 1988.

    Google Scholar 

  19. P.C. Kanellakis. Logic programming and parallel complexity. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 547–586. Morgan Kaufmann Publishers, Inc., 1988.

    Google Scholar 

  20. Anthony Klug. Equivalence of relational algebra and relational calculus query languages having aggregate functions. Journal of the ACM, 29(3):699–717, 1982.

    Google Scholar 

  21. P. G. Kolaitis and C.H. Papadimitriou. Why not negation by fixpoint? In Proceedings of the Sixth ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, pages 231–239, 1987.

    Google Scholar 

  22. G.M. Kuper. Logic programming with sets. In Proceedings of the Sixth ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, pages 11–20, 1987.

    Google Scholar 

  23. Inderpal Mumick, Hamid Pirahesh, and Raghu Ramakrishnan. The magic of duplicates and aggregates. In Proceedings of the Sixteenth International Conference on Very Large Data Bases, 1990. To appear.

    Google Scholar 

  24. G. Ozsoyoglu, Z.M. Ozsoyoglu, and V. Matos. Extending relational algebra and relational calculus with set-valued attributes and aggregate functions. ACM Transactions on Data Base Systems, 12(4):566–592, 1987.

    Google Scholar 

  25. A. Rosenthal, S. Heiler, U. Dayal, and F. Manola. Traversal recursion: A practical approach to supporting recursive applications. In Proceedings of the ACM-SIGMOD 1986 Annual Conference on Management of Data, pages 166–176, 1986.

    Google Scholar 

  26. Yeh-Heng Sheng. IDLOG: Extending the expressive power of deductive database languages. In Proceedings of the ACM-SIGMOD 1990 Annual Conference on Management of Data, pages 54–63, 1990.

    Google Scholar 

  27. S. Tsur and C. Zaniolo. LDL: a logic-based data-language. In Proceedings of the Twelve International Conference on Very Large Data Bases, pages 33–41, 1986.

    Google Scholar 

  28. J.D. Ullman. Principles of Database and Knowledge-Base Systems, volume 1. Computer Science Press, Potomac, Md., 1988.

    Google Scholar 

  29. J.D. Ullman. Principles of Database and Knowledge-Base Systems, volume 2. Computer Science Press, Potomac, Md., 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Serge Abiteboul Paris C. Kanellakis

Rights and permissions

Reprints and permissions

Copyright information

© 1990 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Consens, M.P., Mendelzon, A.O. (1990). Low complexity aggregation in graphlog and Datalog. In: Abiteboul, S., Kanellakis, P.C. (eds) ICDT '90. ICDT 1990. Lecture Notes in Computer Science, vol 470. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53507-1_90

Download citation

  • DOI: https://doi.org/10.1007/3-540-53507-1_90

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-53507-2

  • Online ISBN: 978-3-540-46682-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics