ABSTRACT
Query languages for relational databases have received considerable attention. In 1972 Codd [Cod72] showed that two natural mathematical languages for queries—one algebraic and the other a version of first order predicate calculus—had identical powers of expressibility. Query languages which are as expressive as Codd's Relational Calculus are sometimes called complete. This term is misleading, however, because many interesting queries are not expressible in “complete” languages.
In this paper we show:
Theorem 2: The Fixpoint Hierarchy collapses at the first fixpoint level.
That is, any query expressible with several applications of least fixpoint can already be expressed with one. We also show:
Theorem 1: Let L be a query language consisting of relational calculus plus the least fixpoint operator. Suppose that L contains a relation symbol for a total ordering relation on the domain (e.g. lexicographic ordering). Then the queries expressible in L are exactly the queries computable in polynomial time.
Theorem 1 was discovered independantly by M. Vardi [Var82]. It gives a simple syntactic categorization of those queries which can be answered in polynomial time. Of course queries requiring polynomial time in the size of the database are usually prohibitatively expensive. We also consider weaker languages for expressing less complex queries.
- 1.Aho,A., Hopcroft, J., Ullman,J., The Design and Analysis of Computer Algorithms, Addison-Wesley, 1974. Google ScholarDigital Library
- 2.Aho,A., Ullman,J.D., "Universality of Data Retrieval Languages," 6thSymp. on Principles of Programming Languages, 1979, pp. 110-117. Google ScholarDigital Library
- 3.Chandra,A., "Programming Primitives for Database Languages," 8th Symp. on Principles of Programming Languages, 1981, pp. 50-62. Google ScholarDigital Library
- 4.Chandra,A., Harel,D., "Computable Queries for Relational Databases," JCSS, Vol. 21, No. 2, October, 1980, 156-178.Google ScholarCross Ref
- 5.Chandra,A., Harel,D., "Structure and Complexity of Relational Queries," 21st Symp. on Foundations of Computer Science, 1980, pp: 337-347.Google Scholar
- 6.Chandra,A.,Harel,D., "Horn Clause and the Fixpoint Query Hierarchy," to appear.Google Scholar
- 7.Codd,E.F., "Relational Completeness of Database Sublanguages," in Database Systems, R.Rustin, ed., Prentice-Hall, 1972, pp. 65-98.Google Scholar
- 8.Enderton,H., A Mathematical Introduction to Logic, Academic Press, 1972.Google Scholar
- 9.Harel, David, personal communication.Google Scholar
- 10.Immerman,N., "Upper and Lower Bounds for First Order Expressibility," 21st Symp. on Foundations of Computer Science, 1980, pp. 74-82.Google Scholar
- 11.Immerman,N., "Number of Quantifiers is Better than Number of Tape Cells," JCSS, Vol. 22, No. 3, June, 1981, pp. 384-406.Google ScholarCross Ref
- 12.Immerman,N., "Upper and Lower Bounds for First Order Expressibility," to appear in JCSS. 1982.Google Scholar
- 13.Ullman,J.D., Introduction to Database Systems, Computer Science Press, 1980.Google Scholar
- 14.Vardi,M., "Complexity of Relational Query Languages," this volume.Google Scholar
Index Terms
- Relational queries computable in polynomial time (Extended Abstract)
Recommendations
Relational Semantics of the Lambek Calculus Extended with Classical Propositional Logic
We show that the relational semantics of the Lambek calculus, both nonassociative and associative, is also sound and complete for its extension with classical propositional logic. Then, using filtrations, we obtain the finite model property for the ...
An Extended Relational Algebra on Abstract Objects for Summarizing Answers to Queries
Answers to queries in terms of abstract objects are defined in the logical framework of first order predicate calculus. A partial algebraic characterisation of the supremum and of the infimum of abstract answers is given in an extended Relational ...
Untyped sets, invention, and computable queries
PODS '89: Proceedings of the eighth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systemsConventional database query languages are considered in the context of untyped sets. The algebra without while has the expressive power of the typed complex object algebra. The algebra plus while, and COL with untyped sets (under stratified semantics or ...
Comments