Tractable Iteration Mechanisms for Bag Languages

The goal of this paper is to study tractable iteration mechanisms for bags. The presence of duplicates in bags prevents iteration mechanisms developed in the context of sets to be directly applied to bags without losing tractability. We study two constructs for controlling tractability of iteration over bags. The deflationary fixpoint construct keeps removing elements from a bag until a fixpoint is reached. The bounded fixpoint construct is an inflationary iteration mechanism that never exceeds some predefined bounding bag. We study these constructs in the context of a standard (nested) bag algebra. We show that the deflationary and bounded inflationary fixpoint constructs are equally expressive and strictly more expressive than their set-based counterparts. We also show that, unlike in the set case, the bag algebra with bounded fixpoint fails to capture all PTIME queries over databases with ordered domains. We then show that adding just one construct, which can be used to assign unique tags to duplicates, captures the class of all polynomial time queries over bags when a total ordering on the domain of atomic elements is available. Finally, we compare the expressive powers of the bag algebra and the nested relational algebra with aggregate functions in the presence of these fixpoint operators.

[1]  Limsoon Wong,et al.  Some Properties of Query Languages for Bags , 1993, DBPL.

[2]  Dan Suciu Bounded Fixpoints for Complex Objects , 1993 .

[3]  Limsoon Wong,et al.  Query Languages for Bags and Aggregate Functions , 1997, J. Comput. Syst. Sci..

[4]  Peter Clote,et al.  Computational Models and Function Algebras , 1994, LCC.

[5]  H. E. Rose Subrecursion: Functions and Hierarchies , 1984 .

[6]  Limsoon Wong,et al.  Query languages for bags: expressive power and complexity , 1996, SIGA.

[7]  Dan Suciu,et al.  Fixpoints and Bounded Fixpoints for Complex Objects , 1993 .

[8]  Daniel Leivant,et al.  Logic and Computational Complexity , 1995, Lecture Notes in Computer Science.

[9]  Tova Milo,et al.  Towards tractable algebras for bags , 1993, PODS '93.

[10]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[11]  Dan Suciu,et al.  A Query Language for NC , 1994, LCC.

[12]  Leonid Libkin,et al.  Incremental maintenance of views with duplicates , 1995, SIGMOD '95.

[13]  Marc Gyssens,et al.  A Comparison between Algebraic Query Languages for Flat and Nested Databases , 1991, Theor. Comput. Sci..

[14]  Neil Immerman,et al.  Relational Queries Computable in Polynomial Time , 1986, Inf. Control..

[15]  Dan Suciu,et al.  A query language for NC , 1994, PODS '94.

[16]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[17]  Saharon Shelah,et al.  Fixed-point extensions of first-order logic , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[18]  Edward L. Robertson,et al.  A query language for list-based complex objects , 1994, PODS '94.

[19]  Tova Milo,et al.  An Algebra for Pomsets , 1995, ICDT.

[20]  Surajit Chaudhuri,et al.  Optimization of real conjunctive queries , 1993, PODS '93.

[21]  Jan Krajícek,et al.  Bounded arithmetic, propositional logic, and complexity theory , 1995, Encyclopedia of mathematics and its applications.

[22]  Victor Vianu,et al.  Tractable query languages for complex object databases , 1991, PODS '91.

[23]  Limsoon Wong,et al.  Principles of Programming with Complex Objects and Collection Types , 1995, Theor. Comput. Sci..