Structure and complexity of relational queries

This paper is an attempt at laying the foundations for the classification of queries on relational data bases according to their structure and their computational complexity. Using the operations of composition and fixpoints, a Σ-Π hierarchy of height, ω2, called the fixpoint query hierarchy, is defined, and its properties investigated. The hierarchy includes most of the queries considered in the literature including those of Codd and Aho and Ullman. The hierarchy to level ω characterizes the first-order queries, and the levels up to ω are shown to be strict. Sets of queries larger than the fixpoint query hierarchy are obtained by considering the queries computable in polynomial time, queries computable in polynomial space, etc. It is shown that classes of queries defined from such complexity classes behave (with respect to containment) in a manner very similar to the corresponding complexity classes. Also, the set of second-order queries turns out to be the same as the set of queries defined from the polynomialtime hierarchy. Finally, these classes of queries are used to characterize a set of queries defined from language considerations: those expressible in a programming language with only typed (or ranked) relation variables. At the end of the paper is a list of symbols used therein.

[1]  Ronald Fagin Generalized first-order spectra, and polynomial. time recognizable sets , 1974 .

[2]  M. H. van Emden,et al.  Computation and Deductive Information Retrieval , 1977, Formal Description of Programming Concepts.

[3]  Alfred V. Aho,et al.  Equivalences Among Relational Expressions , 1979, SIAM J. Comput..

[4]  A. Ehrenfeucht An application of games to the completeness problem for formalized theories , 1961 .

[5]  David Harel,et al.  Structure and Complexity of Relational Queries , 1980, FOCS.

[6]  D. C. Cooper,et al.  Theory of Recursive Functions and Effective Computability , 1969, The Mathematical Gazette.

[7]  Larry J. Stockmeyer,et al.  The Polynomial-Time Hierarchy , 1976, Theor. Comput. Sci..

[8]  Ronald Fagin,et al.  Monadic generalized spectra , 1975, Math. Log. Q..

[9]  David Harel,et al.  Horn clauses and the fixpoint query hierarchy , 1982, PODS.

[10]  N. S. Barnett,et al.  Private communication , 1969 .

[11]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[12]  Ashok K. Chandra Programming primitives for database languages , 1981, POPL '81.

[13]  Robert A. Kowalski,et al.  Predicate Logic as Programming Language , 1974, IFIP Congress.

[14]  E. F. Codd,et al.  A Relational Model for Large Shared Data Banks , 1970 .

[15]  Jr. Hartley Rogers Theory of Recursive Functions and Effective Computability , 1969 .

[16]  Jack Minker,et al.  Logic and Data Bases , 1978, Springer US.

[17]  David Harel,et al.  Computable Queries for Relational Data Bases , 1980, J. Comput. Syst. Sci..

[18]  E. F. Codd,et al.  Relational Completeness of Data Base Sublanguages , 1972, Research Report / RJ / IBM / San Jose, California.

[19]  H. Jerome Keisler,et al.  The diversity of quantifier prefixes , 1973, Journal of Symbolic Logic.

[20]  Alfred V. Aho,et al.  Universality of data retrieval languages , 1979, POPL.