Skip to main content

On the power of aggregation in relational query languages

  • Expressive Power
  • Conference paper
  • First Online:

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

Abstract

It is a folk result that relational algebra or calculus extended with aggregate functions cannot compute the transitive closure. However, proving folk results is sometimes a nontrivial task. In this paper, we tell the story of the work on expressive power of relational languages with aggregate functions. We also prove by far the most powerful result that describes the expressiveness of such languages. There are four main features of our result that distinguish it from previous ones:

  1. 1.

    It does not rely on any unproven assumptions, such as separation of complexity classes.

  2. 2.

    It establishes a general property of queries definable with the help of aggregate functions. This property can easily be applied to prove many expressiveness bounds.

  3. 3.

    The class of aggregate functions is much larger than any previously considered.

  4. 4.

    The proof is “non-syntactic.” That is, it does not depend on a specific syntax chosen for the language with aggregates.

Furthermore, our result gives a very general condition that implies inexpressibility of recursive queries such as the transitive closure in an extension of relational calculus with grouping and aggregation. This extension allows us to use rational arithmetic and operations such as summation and product over a column. So, aggregation that exceeds what is allowed by most commercial systems is still not powerful enough to encode recursion mechanisms.

Part of this work was done while the first author was visiting Institute of Systems Science.

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. S. Abiteboul, R. Hull, V. Vianu, Foundations of Databases, Addison Wesley, 1995.

    Google Scholar 

  2. A. V. Aho and J. D. Ullman. Universality of data retrieval languages. In Proceedings of 6th Symposium on Principles of Programming Languages, Texas, pages 110–120, January 1979.

    Google Scholar 

  3. D.A. Barrington, N. Immerman, H. Straubing. On uniformity within NCI. JCSS, 41:274–306,1990.

    Google Scholar 

  4. P. Buneman, S. Naqvi, V. Tannen, L. Wong. Principles of programming with complex objects and collection types. Theoretical Computer Science, 149(1):3–48, September 1995.

    Google Scholar 

  5. M. Consens and A. Mendelzon. Low complexity aggregation in GraphLog and Datalog, Theoretical Computer Science 116 (1993), 95–116. Extended abstract in ICDT'90.

    Google Scholar 

  6. G. Dong, L. Libkin, L. Wong. Local properties of query languages. Proc. Int. Conf. on Database Theory, Springer LNCS 1186, 1997, pages 140–154.

    Google Scholar 

  7. H. D. Ebbinghaus and J. Flum. Finite Model Theory. Springer Verlag, 1995.

    Google Scholar 

  8. K. Etessami. Counting quantifiers, successor relations, and logarithmic space, Journal of Computer and System Sciences 54 (1996), 400–411. Extended abstract in Structure in Complexity'95.

    Google Scholar 

  9. R. Fagin. Easier ways to win logical games. In Proc. DIMACS Workshop on Finite Model Theory and Descriptive Complexity, 1996.

    Google Scholar 

  10. R. Fagin, L. Stockmeyer, M. Vardi, On monadic NP vs monadic co-NP, Information and Computation, 120 (1994), 78–92.

    Google Scholar 

  11. H. Gaifman, On local and non-local properties, in “Proceedings of the Herbrand Symposium, Logic Colloquium '81,” North Holland, 1982.

    Google Scholar 

  12. S. Grumbach, L. Libkin, T. Milo and L. Wong. Query languages for bags: expressive power and complexity. SIGACT News, 27 (1996), 30–37.

    Google Scholar 

  13. Y. Gurevich. Toward logic tailored for computational complexity. In Proceedings of Computation and Proof Theory, Springer Lecture Notes in Mathematics, vol. 1104, 1984, pages 175–216.

    Google Scholar 

  14. N. Immerman. Languages that capture complexity classes. SIAM Journal of Computing, 16:760–778, 1987.

    Google Scholar 

  15. N. Immerman and E. Lander. Describing graphs: A first order approach to graph canonization. In “Complexity Theory Retrospective”, Springer Verlag, Berlin, 1990.

    Google Scholar 

  16. L. Libkin. On the forms of locality over finite models. In LICS'97, pages 204–215.

    Google Scholar 

  17. L. Libkin and L. Wong. Query languages for bags and aggregate functions. JCSS, 55 (1997), 241–272.

    Google Scholar 

  18. L. Libkin and L. Wong. Aggregate functions, conservative extension, and linear orders, in “Proceedings of 4th International Workshop on Database Programming Languages,” Manhattan, New York, August 1993.

    Google Scholar 

  19. L. Libkin and L. Wong. Conservativity of nested relational calculi with internal generic functions. Information Processing Letters, 49 (1994), 273–280.

    Google Scholar 

  20. I. Niven and H.S. Zuckerman. Introduction to the Theory of Numbers. Wiley, 1980.

    Google Scholar 

  21. J. Nurmonen. On winning strategies with unary quantifiers. J. Logic and Computation, 6 (1996), 779–798.

    Google Scholar 

  22. L. Wong. Normal forms and conservative properties for query languages over collection types. JCSS 52(1):495–505, June 1996.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Sophie Cluet Rick Hull

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Libkin, L., Wong, L. (1998). On the power of aggregation in relational query languages. In: Cluet, S., Hull, R. (eds) Database Programming Languages. DBPL 1997. Lecture Notes in Computer Science, vol 1369. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-64823-2_15

Download citation

  • DOI: https://doi.org/10.1007/3-540-64823-2_15

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64823-9

  • Online ISBN: 978-3-540-68534-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics