Abstract
Expressiveness of database query languages remains the major motivation for research in finite model theory. However, most techniques in finite model theory are based on Ehrenfeucht-Fraisse games, whose application often involves a rather intricate argument. Furthermore, most tools apply to first-order logic and some of its extensions, but not to languages that resemble real query languages, like SQL.
In this paper we use locality to analyze expressiveness of query languages. A query is local if, to determine if a tuple belongs to the output, one only has to look at a certain predetermined portion of the input.
We study local properties of queries in a context that goes beyond the pure first-order case, and then apply the resulting tools to analyze expressive power of SQL-like languages. We first prove a general result describing outputs of local queries, that leads to many easy inexpressibility proofs. We then consider a closely related bounded degree property, which describes the outputs of queries on structures that locally look “simple,” and makes inexpressibility proofs particularly easy. We prove that every local query has this property. Since every relational calculus (first-order) query is local, these results can be viewed as “off-the-shelf” strategies for inexpressibility proofs, which are often easier to apply than the games. We also show that some generalizations of the bounded degree property that were conjectured to hold, fail for relational calculus.
We then prove that the language obtained from relational calculus by adding grouping and aggregates (essentially plain SQL), has the bounded degree property, thus solving an open problem. Consequently, first-order queries with Härtig and Rescher quantifiers have the bounded degree property. Finally, we apply our results to show that SQL and relational calculus are incapable of maintaining the transitive closure view even in the presence of certain kinds of auxiliary data.
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, V. Vianu, Foundations of Databases, Addison Wesley, 1995.
S. Abiteboul, P. Kanellakis. Query languages for complex object databases. SIGACT News, 21(3):9–18, 1990.
M. Ajtai and R. Fagin. Reachability is harder for directed than for undirected graphs. Journal of Symbolic Logic, 55(1):113–150, March 1990.
J. Albert. Algebraic properties of bag data types. In VLDB'91, pages 211–219.
J. Barwise et al eds., Model-Theoretic Logics. Springer-Verlag, 1985.
P. Buneman, S. Naqvi, V. Tannen, L. Wong. Principles of programming with complex objects and collection types. Theoretical Computer Science, 149 (1995), 3–48.
S. Chaudhuri, M. Y. Vardi, Optimization of real conjunctive queries, In PODS'93.
M.P. Consens, A.O. Mendelzon, Low complexity aggregation in GraphLog and Datalog, Theoretical Computer Science 116 (1993), 95–116.
G. Dong, L. Libkin, L. Wong. On impossibility of decremental recomputation of recursive queries in relational calculus and SQL. In Database Progr. Lang. '95, Springer Electronic Workshops in Computing, 1996.
G. Dong, L. Libkin, L. Wong. Local properties of query languages, Tech. Memo, Bell Labs, 1995.
G. Dong and J. Su. Incremental and Decremental Evaluation of Transitive Closure by First-Order Queries. Information and Computation, 120(1):101–106, 1995.
G. Dong and J. Su. Space-bounded FOIES. In PODS'95, pages 139–150.
H.-D. Ebbinghaus and J. Flum. Finite Model Theory. Springer Verlag, 1995.
K. Etessami, Counting quantifiers, successor relations, and logarithmic space, in Conf. on Structure in Complexity Theory, 1995.
R. Fagin, L. Stockmeyer, M. Vardi, On monadic NP vs monadic co-NP, Information and Computation, 120 (1994), 78–92.
H. Gaifman, On local and non-local properties, in Logic Colloquium '81, North Holland, 1982.
T. Griffin, L. Libkin, Incremental maintenance of views with duplicates, In SIGMOD'95, pages 319–330.
S. Grumbach, T. Milo, Towards tractable algebras for bags, Journal of Computer and System Sciences, 52 (1996), 570–588.
S. Grumbach, L. Libkin, T. Milo and L. Wong. Query languages for bags: expressive power and complexity. SIGACT News, 27 (1996), 30–37.
S. Grumbach and C. Tollu. On the expressive power of counting. Theoretical Computer Science 149(1): 67–99, 1995.
A. Klug, Equivalence of relational algebra and relational calculus query languages having aggregate functions, Journal of the ACM 29, No. 3 (1982), 699–717.
L. Libkin, L. Wong, Some properties of query languages for bags, In DBPL'93, Springer, 1994.
L. Libkin, L. Wong, Query languages for bags and aggregate functions. JCSS, to appear. Extended abstract in PODS'94, pages 155–166.
L. Libkin, L. Wong, On representation and querying incomplete information in databases with bags, Information Processing Letters 56 (1995), 209–214.
G. Ozsoyoglu, Z. M. Ozsoyoglu, V. Matos, Extending relational algebra and relational calculus with set-valued attributes and aggregate functions, ACM Transactions on Database Systems 12, No. 4 (1987), 566–592.
J. Paredaens and D. Van Gucht. Converting nested relational algebra expressions into flat algebra expressions. ACM TODS, 17(1):65–93, March 1992.
S. Patnaik and N. Immerman. Dyn-FO: A parallel dynamic complexity class. In PODS'94, pages 210–221.
L. Wong, Normal forms and conservative properties for query languages over collection types, JCSS 52 (1996), 495–505.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dong, G., Libkin, L., Wong, L. (1996). Local properties of query languages. In: Afrati, F., Kolaitis, P. (eds) Database Theory — ICDT '97. ICDT 1997. Lecture Notes in Computer Science, vol 1186. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62222-5_42
Download citation
DOI: https://doi.org/10.1007/3-540-62222-5_42
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-62222-2
Online ISBN: 978-3-540-49682-3
eBook Packages: Springer Book Archive