ABSTRACT
A query Q is determined by a set of views V if, whenever V (I1) = V (I2) for two database instances I1, I2 then also Q(I1) = Q(I2). Does this imply that Q can be rewritten as a query Q0 that only uses the views V?.
For first-order (FO) queries and view definitions over possibly infinite databases, the answer is yes, as follows from old results of Beth and Craig. We say that FO is complete for FO-to-FO rewritings. However, Nash, Segoufin and Vianu (2007) prove that if the query and the view definitions are given by conjunctive queries, then it might not be possible to formulate Q' as a conjunctive query. In other words, CQ is not complete for CQ-to-CQ rewritings.
Here we consider queries and view definitions in the packed fragment (PF) of first-order logic. This is a generalization of the guarded fragment, a fragment of particular interest to database theory. Gottlob et.al. 2002 show that the guarded conjunctive queries are exactly the acyclic queries. Leinders et.al. 2005 characterize the entire guarded fragment by the semijoin algebra.
We show that for both finite and unrestricted databases, PF is complete for PF-to-PF rewritings. The same holds for packed (unions of) conjunctive queries. In both cases, we provide algorithms for testing whether a query is determined by a set of views, and for actually rewriting Q to Q'. To compare: these problems are undecidable for full FO, and still open for conjunctive queries.
Supplemental Material
- H. Andréka, J. van Benthem, and I. Németi. Modal languages and bounded fragments of predicate logic. Journal of Philosophical Logic, 27(3):217--274, 1998.Google Scholar
- F. Baader and W. Nutt. Basic description logics. In The description logic handbook: theory, implementation, and applications, pages 43--95. Cambridge University Press, New York, NY, USA, 2003. Google Scholar
Digital Library
- E. Beth. On Padoa's method in the theory of definition. Indagationes Mathematicae, 15:330--339, 1953.Google Scholar
Cross Ref
- E. Beth. Formal methods, An introduction to symbolic logic and to the study of effective operations in arithmetic and logic. Number 4 in Synthese Library. Reidel, Dordrecht, 1962.Google Scholar
- D. Calvanese, G. De Giacomo, M. Lenzerini, and M. Vardi. Lossless regular views. In Proceedings PODS, pages 247--258, 2002. Google Scholar
Digital Library
- C. Chang and H. Keisler. Model Theory. North-Holland, 1973.Google Scholar
- W. Craig. Three uses of the Herbrand-Gentzen theorem in relation to model theory and proof theory. Journal of Symbolic Logic, 22:269--285, 1957.Google Scholar
Cross Ref
- K. Doets. Basic Model Theory. CSLI Publications, Stanford, 1996.Google Scholar
- M. Fitting. First Order Logic and Automated Theorem Proving (second edition). Springer Verlag, 1996. Google Scholar
Digital Library
- J. Flum, M. Frick, and M. Grohe. Query evaluation via tree-decompositions. In Proceedings ICDT, pages 22--38, 2001. Google Scholar
Digital Library
- H. Friedman. The complexity of explicit definitions. Advances in Mathematics, 20(1):18--29, 1976.Google Scholar
Cross Ref
- G. Gottlob, N. Leone, and F. Scarcello. Robbers, marshals, and guards: game theoretic and logical characterizations of hypertree width. J. Comput. Syst. Sci., 66(4):775--808, 2003. Google Scholar
Digital Library
- E. Grädel. On the restraining power of guards. Journal of Symbolic Logic, 64(4):1719--1742, 1999.Google Scholar
Cross Ref
- E. Grädel. Guarded fixed point logics and the monadic theory of countable trees. Theor. Comput. Sci., 288(1):129--152, 2002. Google Scholar
Digital Library
- S. Grumbach and L. Tininini. On the content of materialized aggregate views. In Proceedings PODS, pages 47--57, 2000. Google Scholar
Digital Library
- I. Hodkinson. Loosely guarded fragment of first-order logic has the finite model property. Studia Logica, 70(2):205--240, 2002.Google Scholar
- E. Hoogland. Algebraic characterizations of various beth definability properties. Studia Logica, 65(1):91--112, 2000.Google Scholar
Cross Ref
- E. Hoogland and M. Marx. Interpolation in the guarded fragment. Studia Logica, 70(3):273--409, 2002.Google Scholar
Cross Ref
- E. Hoogland, M. Marx, and M. Otto. Beth definability for the guarded fragment. In H. Ganzinger, D. McAllester, and A. Voronkov, editors, Logic for Programming and Automated Reasoning, 6th International Conference LPAR99, Tbilisi, Georgia, volume 1705 of LNAI, pages 273--285. Springer, 1999. Google Scholar
Digital Library
- D. Leinders, M. Marx, J. Tysziewicz, and J. van den Bussche. The semijoin algebra and the guarded fragment. Journal of Logic, Language and Information, 14:331--343, 2005. Google Scholar
Digital Library
- M. Marx and Y. Venema. Local variations on a loose theme: modal logic and decidability. In E. Grädel, P. Kolaitis, L. Libkin, M. Marx, J. Spencer, M. Vardi, Y. Venema, and S. Weinstein, editors, Finite Model Theory and its Applications. Springer-Verlag, 2007.Google Scholar
- A. Nash, L. Segoufin, and V. Vianu. Determinacy and rewriting of conjunctive queries using views: a progress report. In Proceedings ICDT 2007, to appear. Google Scholar
Digital Library
- D. Pigozzi. Amalgamation, congruence extension and interpolation properties in algebras. Algebra Universalis, 1:269--349, 1972.Google Scholar
Cross Ref
- L. Segoufin and V. Vianu. Views and queries: determinacy and rewriting. In Proceedings PODS, pages 49--60, 2005. Google Scholar
Digital Library
- A. Tarski. Einige methodologische Untersuchungen über die Definierbarkeit der Begriffe. Erkenntnis, 5:80--100, 1935.Google Scholar
Cross Ref
- A. Tarski. Logic, semantics and metamathematics. Clarendon, Oxford, 1956.Google Scholar
- B. ten Cate. Interpolation for extended modal languages. Journal of Symbolic Logic, 70(1):223--234, 2005.Google Scholar
Cross Ref
- B. ten Cate, W. Conradi, M. Marx, and Y. Venema. Definitorially complete description logics. In Proceedings KR 2006, pages 79--89, 2006.Google Scholar
- J. Van den Bussche. Applications of Alfred Tarski's ideas in database theory. Lecture Notes in Computer Science, 2142:20--37, 2001. Google Scholar
Digital Library
- P. van Ulsen. E. W. Beth als logicus. PhD thesis, University of Amsterdam, 2000.Google Scholar
- A. Visser. Uniform interpolation and layered bisimulation. In Gädel '96 (Brno, 1996), volume 6 of Lecture Notes Logic, pages 139--164. Springer, Berlin, 1996.Google Scholar
Index Terms
Queries determined by views: pack your views
Recommendations
Determinacy and query rewriting for conjunctive queries and views
Answering queries using views is the problem which examines how to derive the answers to a query when we only have the answers to a set of views. Constructing rewritings is a widely studied technique to derive those answers. In this paper we consider ...
Query Folding
ICDE '96: Proceedings of the Twelfth International Conference on Data EngineeringQuery folding refers to the activity of determining if and how a query can be answered using a given set of resources, which might be materialized views, cached results of previous queries, or queries answerable by other databases. We investigate query ...
Query containment for data integration systems
Special issue on PODS 2000The problem of query containment is fundamental to many aspects of database systems, including query optimization, determining independence of queries from updates, and rewriting queries using views. In the data-integration framework, however, the ...






Comments