Abstract
The declarative programming paradigms used in constraint languages can lead to powerful extensions of Codd's relational data model. The development of constraint database query languages from logical database query languages has many similarities with the development of constraint logic programming from logic programming, but with the additional requirements of data efficient, set-at-a-time, and bottomup evaluation. In this overview of constraint query languages (CQLs) we first present the framework of [41]. The principal idea is that: “the k-tuple (or record) data type can be generalized by a conjunction of quantifier-free constraints over k variables”. The generalization must preserve various language properties of the relational data model, e.g., the calculus/algebra equivalence, and have time complexity polynomial in the size of the data. We next present an algebra for dense order constraints that is simpler to evaluate than the calculus described in [41], and we sharpen some of the related data complexity bounds. We note that CQLs are applicable to spatial databases. This is because these languages have “spatial point set” as the semantics of their record data type and because existing multi-dimensional searching data structures can support I/O efficient access to sets of records. Finally, we observe that CQLs can be augmented with complex object data types, aggregate operations, and null-values, just like the relational data model.
Research was supported by ONR grant N00014-91-J-4052 ARPA Order No. 8225.
Preview
Unable to display preview. Download preview PDF.
References
S. Abiteboul, C. Beeri. On the Power of Languages for the Manipulation of Complex Objects. INRIA Research Report 846, 1988.
S. Abiteboul and P. Kanellakis. Database Theory Column: Query Languages for Complex Object Databases. SIGACT News, 21, pp. 9–18, 1990.
S. Abiteboul and V. Vianu. Datalog Extensions for Database Queries and Updates. J. Comput. System Sci., 43 (1991), pp. 62–124.
A.K. Aylamazyan, M.M. Gilula, A.P. Stolboushkin, G.F. Schwartz. Reduction of the Relational Model with Infinite Domain to the Case of Finite Domains. Proc. USSR Acad. of Science (Doklady), 286(2):308–311, 1986.
D.A. Barrington, N. Immerman, H. Straubing. On Uniformity within NC1. JCSS, 41:274–306, 1990.
M. Baudinet, M. Niezette, P. Wolper. On the Representation of Infinite Temporal Data and Queries. Proc. 10th ACM PODS, 280–290, 1991.
R. Bayer, E. McCreight. Organization of Large Ordered Indexes. Acta Informatica, 1:173–189, 1972.
M. Ben-Or, D. Kozen, J. Reif. The Complexity of Elementary Algebra and Geometry. JCSS, 32:251–264, 1986.
L. Berman. Precise Bounds for Presburger Arithmetic and the Reals with Addition. Proc. 18th IEEE FOCS, pp. 95–99, 1977.
A.H. Borning. The Programming Language Aspects of ThingLab, A Constraint-Oriented Simulation Laboratory. ACM TOPLAS 3:4:353–387, 1981.
A. Brodsky, J. Jaffar, M.J. Maher. Toward Practical Constraint Databases. Proc. 19th VLDB, 322–331, 1993.
A. Brodsky, C. Lassez. Separability of Polyhedra and a New Approach to Spatial Storage. in [42].
A. Brodsky, Y. Sagiv. Inference of Monotonicity Constraints in Datalog Programs. Proc. 8th ACM PODS, 190–200, 1989.
A. Brodsky, Y. Sagiv. Inference of Inequality Constraints in Logic Programs. Proc. 10th ACM PODS, 227–241, 1991.
A.R. Bruss, A.R. Meyer. On Time-Space Classes and their Relation to the Theory of Real Addition. Proc. 10th ACM STOC, pp. 233–239, 1978.
S.R. Buss. The Formula Value Problem is in ALOGTIME. Proc. 19th ACM STOC, pp. 123–131, 1987.
A.K. Chandra, D. Harel. Structure and Complexity of Relational Queries. JCSS, 25:1:99–128, 1982.
J. Chomicki. Ptime Query Processing in Temporal Deductive Databases. Proc. 9th ACM PODS, 379–391, 1990.
J. Chomicki, T. Imielinski. Relational Specifications of Infinite Query Answers. Proc. ACM SIGMOD, 174–183, 1989.
E.F. Codd. A Relational Model for Large Shared Data Banks. CACM, 13:6:377–387, 1970.
J. Cohen. Constraint Logic Programming Languages. CACM, 33:7:52–68, 1990.
A. Colmerauer. An Introduction to Prolog III. CACM, 33:7:69–90, 1990.
G.E. Collins. Quantifier Elimination for Real Closed Fields by Cylindrical Algebraic Decomposition. Proc. 2nd GI conference on Automata Theory and Languages, LNCS 33, pp. 512–532, Springer-Verlag, 1975.
D. Comer. The Ubiquitous B-Tree. Computing Surveys, 11:2:121–137, 1979.
S.S. Cosmadakis, G.M. Kuper Expressiveness of First-Order Constraint Languages. Manuscript, December 1993.
J. Cox, K. McAloon, C. Tretkoff. Computational Complexity and Constraint Logic Programming. Annals of Math, and AI, 5:163–190, 1992.
M. Dincbas, P. Van Hentenryck, H. Simonis, A. Aggoun, T. Graf, F. Berthier. The Constraint Logic Programming Language CHIP. Proc. Fifth Generation Computer Systems, Tokyo Japan, 1988.
J. Ferrante, J.R. Geiser. An Efficient Decision Procedure for the Theory of Rational Order. Theoretical Computer Science, 4:227–233, 1977.
J. Ferrante, C. Rackoff. A Decision Procedure for the First Order Theory of Real Addition with Order. SICOMP, 4:1:69–76, 1975.
M.J. Fischer, M.O. Rabin. Super-Exponential Complexity of Presburger Arithmetic. SIAM-AMS Proc. volume VII, American Mathematical Society, 1974.
E. Freuder. Synthesizing Constraint Expressions. CACM, 21:11, 1978.
Y. Gurevich, S. Shelah. Fixed-Point Extensions of First-Order Logic. Annals of Pure and Applied Logic, 32, 265–280, 1986.
M.R. Hansen, B.S. Hansen, P. Lucas, P. van Emde Boas. Integrating Relational Databases and Constraint Languages. Computer Languages, 14:2:63–82, 1989.
R. Helm, K. Marriott, M. Odersky. Constraint-based Query Optimization for Spatial Databases. Proc. 10th ACM PODS, 181–191, 1991.
R. Hull, J. Su. Domain Independence and the Relational Calculus. Technical Report 88-64, University of Southern California.
N. Immerman. Relational Queries Computable in Polynomial Time. Information and Control, 68:86–104, 1986.
J. Jaffar, J.L. Lassez. Constraint Logic Programming. Proc. 14th ACM POPL, 111–119, 1987.
D.S. Johnson. A Catalogue of Complexity Classes. Handbook of Theoretical Computer Science, Vol. A, chapter 2, (J. van Leeuwen editor), North-Holland, 1990.
F. Kabanza, J-M. Stevenne, P. Wolper. Handling Infinite Temporal Data. Proc. 9th ACM PODS, 392–403, 1990.
P.C. Kanellakis. Elements of Relational Database Theory. Handbook of Theoretical Computer Science, Vol. B, chapter 17, (J. van Leeuwen editor), North-Holland, 1990.
P. C. Kanellakis, G. M. Kuper, P. Z. Revesz. Constraint Query Languages. Proc. 9th ACM PODS, 299–313, 1990. Full version available as Brown Univ. Tech. Rep. CS-92-50. To appear in JCSS.
P.C. Kanellakis, J.L. Lassez, V.J. Saraswat. Proceedings of the Workshop on the Principles and Practice of Constraint Programming (PPCP93). Newport RI, April 1993. Preliminary version available via anonymous ftp from wilma.cs.brown.edu (128.148.33.66) in the directory/pub/ppcp93. To appear from MIT Press.
P. C. Kanellakis, S. Ramaswamy, D. E. Vengroff, J. S. Vitter. Indexing for Data Models with Constraints and Classes. Proc. 12th ACM PODS, 233–243, 1993.
M. Kifer. On Safety, Domain Independence, and Capturability of Database Queries. Proc. International Conference on Databases and Knowledge Bases, Jerusalem Israel, 1988.
A. Klug. Equivalence of Relational Algebra and Relational Calculus Query Languages having Aggregate Functions. JACM, 29:3:699–717, 1982.
A. Klug. On Conjunctive Queries Containing Inequalities. JACM, 35:1:146–160, 1988.
P. Kolaitis, C.H. Papadimitriou. Why not Negation by Fixpoint? Proc. 7th ACM PODS, 231–239, 1988.
D. Kozen, C. Yap. Algebraic Cell Decomposition in NC. Proc. 26th IEEE FOCS, 515–521, 1985.
M. Koubarakis. Foundations of Temporal Constraint Databases. PhD Thesis. Nat. Tech. Univ. of Athens and Imperial College. 1993.
G.M. Kuper. Aggregation in Constraint Databases. in [42].
W. Leler. Constraint Programming Languages. Addison Wesley, 1987.
A. Levy, Y. Sagiv. Constraints and Redundancy in Datalog. Proc. 11th ACM PODS, 67–81, 1992.
E. McCreight. Priority Search Trees. SIAM J. Computing, 14:257–276, 1985.
A.K. Mackworth. Consistency in Networks of Relations. AI, 8:1, 1977.
U. Montanari. Networks of Constraints: Fundamental Properties and Application to Picture Processing. Information Science, 7, 1974.
I. S. Mumick, S. J. Finkelstein, H. Pirahesh, R. Ramakrishnan. Magic Conditions. Proc. 9th ACM PODS, 314–330, 1990.
F.P. Preparata, M.I. Shamos. Computational Geometry: An Introduction. Springer-Verlag, 1985.
R. Ramakrishnan. Magic Templates: A Spellbinding Approach to Logic Programs. Proc. 5th International Conference on Logic Programming, 141–159, 1988.
S. Ramaswamy, S. Subramanian. Path Caching: A Technique for Optimal External Searching. Manuscript submitted for publication.
J. Renegar. On the Computational Complexity and Geometry of the First-order Theory of the Reals: Parts I–III. Journal of Symbolic Computation, 13:255–352, 1992.
P.Z. Revesz. A Closed Form for Datalog Queries with Integer Order. Proc. 3rd International Conference on Database Theory, 1990, (to appear in TCS).
H. Samet. Applications of Spatial Data Structures: Computer Graphics, Image Processing, and GIS. Addison-Wesley, Reading MA, 1990.
H. Samet. The Design and Analysis of Spatial Data Structures. Addison-Wesley, Reading MA, 1990.
V.A. Saraswat. Concurrent Constraint Programming Languages. PhD thesis, Carnegie Mellon University, 1989.
D. Srivastava, R. Ramakrishnan. Pushing Constraint Selections. Proc. 11th ACM PODS, 301–316, 1992.
G.L. Steele. The Definition and Implementation of a Computer Programming Language Based on Constraints. Ph.D. thesis, MIT, AI-TR 595, 1980.
I.E. Sutherland. SKETCHPAD: A Man-Machine Graphical Communication System. Spartan Books, 1963.
A. Tarski. A Decision Method for Elementary Algebra and Geometry. University of California Press, Berkeley, California, 1951.
J.D. Ullman. Principles of Database Systems. Computer Science Press, 2nd Ed., 1982.
R. van der Meyden. The Complexity of Querying Indefinite Data about Linearly Ordered Domains. Proc. 11th ACM PODS, 331–346, 1992.
A. Van Gelder. Deriving Constraints among Argument Sizes in Logic Programs. Proc. 9th ACM PODS, 47–60, 1990.
P. Van Hentenryck. Constraint Satisfaction in Logic Programming. MIT Press, 1989.
M.Y. Vardi. The Complexity of Relational Query Languages. Proc. 14th ACM STOC, 137–146, 1982.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kanellakis, P.C., Goldin, D.Q. (1994). Constraint programming and database query languages. In: Hagiya, M., Mitchell, J.C. (eds) Theoretical Aspects of Computer Software. TACS 1994. Lecture Notes in Computer Science, vol 789. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57887-0_92
Download citation
DOI: https://doi.org/10.1007/3-540-57887-0_92
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57887-1
Online ISBN: 978-3-540-48383-0
eBook Packages: Springer Book Archive