Abstract
We examine the power of incremental evaluation systems that use an SQL-like language for maintaining recursively-defined views. We show that recursive queries such as transitive closure, and “alternating paths” can be incrementally maintained in a nested relational language, when some auxiliary relations are allowed. In the presence of aggregate functions, even more queries can be maintained, for example, the “same generation” query. In contrast, it is still an open problem whether such queries are maintainable in relational calculus. We then restrict the language so that no nested relations are involved (but we keep the aggregate functions). Such a language captures the capability of most practical relational database systems. We prove that this restriction does not reduce the incremental computational power; that is, any query that can be maintained in a nested language with aggregates, is still maintainable using only fiat relations. We also show that one does not need auxiliary relations of arity more than 2. In particular, this implies that the recursive queries maintainable in the nested language with aggregates, can be also maintained in a practical relational database systems using auxiliary tables of arity at most 2. This is again in sharp contrast to maintenance in relational calculus, which admits a strict arity-based hierarchy.
Part of this work was done when Wong was visiting Bell Labs and when Libkin 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.
References
S. Abiteboul, R. Hull and V. Vianu. Foundations of Databases. Addison Wesley, 1995.
S. Abiteboul and P. Kanellakis. Query languages for complex object databases. SIGACT News, 21(3):9–18, 1990.
A. Aho and J. Ullman. Universality of data retrieval languages. In Proceedings 6th Symposium on Principles of Programming Languages, Texas, January 1979, pages 110–120, 1979.
P. Buneman, L. Libkin, D. Suciu, V. Tannen, and L. Wong. Comprehension syntax. SIGMOD Record, 23(1):87–96, March 1994.
P. Buneman, S. Naqvi, V. Tannen, and L. Wong. Principles of programming with complex objects and collection types. Theoretical Computer Science, 149(1):3–48, September 1995.
J.-Y. Cai. Lower bound for constant-depth circuits in the presence of help bits. Information Processing Letters, 36:79–83, 1990.
G. Dong, L. Libkin, and L. Wong. On impossibility of decremental recomputation of recursive queries in relational calculus and SQL. In Proceedings of 5th International Workshop on Database Programming Languages, Gubbio, Italy, September 1995, Springer Electronic Workshops in Computing, 1996. Available at http: //www.springer.co.uk /eWiC /Workshops /DBPL5.htm1.
G. Dong, L. Libkin, and L. Wong. Local properties of query languages. In Proceedings of 6th International Conference on Database Theory, pages 140–154, Delphi, Greece, January 1997.
G. Dong and J. Su. Incremental and decrementa evaluation of transitive closure by first-order queries. Information and Computation, 120(1):101–106, July 1995.
G. Dong and J. Su. Space-bounded FOIES. In Proceedings of 14th ACM Symposium on Principles of Database Systems, San Jose, California, pages 139–150, May 1995.
G. Dong and J. Su. Deterministic FOIES are strictly weaker. Annals of Mathematics and Artificial Intelligence 19(1):127–146, 1997.
G. Dong, J. Su, and R. Topor. Nonrecursive incremental evaluation of Datalog queries. Annals of Mathematics and Artificial Intelligence, 14:187–223, 1995.
G. Dong and L. Wong. Some relationships between FOIES and El arity hierarchies. Bulletin of EATCS, 61:72–79, 1997.
N. Immerman. Languages that capture complexity classes. SIAM Journal of Computing, 16:760–778, 1987.
L. Libkin and L. Wong. Aggregate functions, conservative extension, and linear orders. In C. Beeri, A. Ohori, and D. Shasha, editors, Proceedings of 4th International Workshop on Database Programming Languages, New York, August 1993, pages 282–294. Springer-Verlag, January 1994.
L. Libkin and L. Wong. Conservativity of nested relational calculi with internal generic functions. Information Processing Letters, 49(6):273–280, March 1994.
L. Libkin and L. Wong. Query languages for bags and aggregate functions. Journal of Computer and System Sciences, 55 (1997), 241–272.
L. Libkin and L. Wong. Incremental recomputation of recursive queries with nested sets and aggregate functions. Technical Report 97-224-0, Institute of Systems Science, Heng Mui Keng Terrace, Singapore 119597, April 1997.
J. Paredaens and D. Van Gucht. Converting nested relational algebra expressions into flat algebra expressions. ACM Transaction on Database Systems, 17(1):65–93, March 1992.
S. Patnaik and N. Irnmerman. Dyn-FO: A parallel dynamic complexity class. In Proceedings of 13th ACM Symposium on Principles of Database Systems, pages 210–221, Minneapolis, Minnesota, May 1994.
P. Wadler. Comprehending monads. Mathematical Structures in Computer Science, 2:461–493, 1992.
L. Wong. Querying Nested Collections. PhD thesis, Department of Computer and Information Science, University of Pennsylvania, Philadelphia, PA 19104, August 1994. Available as University of Pennsylvania IRCS Report 94-09.
L. Wong. Normal forms and conservative extension properties for query languages over collection types. Journal of Computer and System Sciences, 52(3):495–505, June 1996.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Libkin, L., Wong, L. (1998). Incremental recomputation of recursive queries with nested sets and aggregate functions. 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_13
Download citation
DOI: https://doi.org/10.1007/3-540-64823-2_13
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