Rewriting queries using views in the presence of arithmetic comparisons

Foto Afrati, Chen Li, Prasenjit Mitra

Research output: Contribution to journalArticle

19 Citations (Scopus)

Abstract

We consider the problem of answering queries using views, where queries and views are conjunctive queries with arithmetic comparisons over dense orders. Previous work only considered limited variants of this problem, without giving a complete solution. We first show that obtaining equivalent rewritings for conjunctive queries with arithmetic comparisons is decidable. Then, we consider the problem of finding maximally contained rewritings (MCRs) where the decidability proof does not carry over. We investigate two special cases of this problem where the query uses only semi-interval comparisons. In both cases decidability of finding MCRs depends on the query containment test. First, we address the case where the homomorphism property holds in testing query containment. In this case decidability is easy to prove but developing an efficient algorithm is not trivial. We develop such an algorithm and prove that it is sound and complete. This algorithm applies in many cases where the query uses only left (or right) semi-interval comparisons. Then, we develop a new query containment test for the case where the containing query uses both left and right semi-interval comparisons but with only one left (or right) semi-interval subgoal. Based on this test, we show how to produce an MCR which is a Datalog query with arithmetic comparisons. The containment test that we develop obtains a result of independent interest. It finds another special case where query containment in the presence of arithmetic comparisons can be tested in nondeterministic polynomial time.

Original languageEnglish
Pages (from-to)88-123
Number of pages36
JournalTheoretical Computer Science
Volume368
Issue number1-2
DOIs
Publication statusPublished - 5 Dec 2006
Externally publishedYes

Fingerprint

Query Rewriting
Computability and decidability
Query
Rewriting
Decidability
Polynomials
Acoustic waves
Interval
Testing
Datalog
Homomorphism
Polynomial time

Keywords

  • Databases
  • Query languages
  • Query rewriting

ASJC Scopus subject areas

  • Computational Theory and Mathematics

Cite this

Rewriting queries using views in the presence of arithmetic comparisons. / Afrati, Foto; Li, Chen; Mitra, Prasenjit.

In: Theoretical Computer Science, Vol. 368, No. 1-2, 05.12.2006, p. 88-123.

Research output: Contribution to journalArticle

Afrati, Foto ; Li, Chen ; Mitra, Prasenjit. / Rewriting queries using views in the presence of arithmetic comparisons. In: Theoretical Computer Science. 2006 ; Vol. 368, No. 1-2. pp. 88-123.
@article{baa2e0c847974f3a87ffa3e37aaa93c0,
title = "Rewriting queries using views in the presence of arithmetic comparisons",
abstract = "We consider the problem of answering queries using views, where queries and views are conjunctive queries with arithmetic comparisons over dense orders. Previous work only considered limited variants of this problem, without giving a complete solution. We first show that obtaining equivalent rewritings for conjunctive queries with arithmetic comparisons is decidable. Then, we consider the problem of finding maximally contained rewritings (MCRs) where the decidability proof does not carry over. We investigate two special cases of this problem where the query uses only semi-interval comparisons. In both cases decidability of finding MCRs depends on the query containment test. First, we address the case where the homomorphism property holds in testing query containment. In this case decidability is easy to prove but developing an efficient algorithm is not trivial. We develop such an algorithm and prove that it is sound and complete. This algorithm applies in many cases where the query uses only left (or right) semi-interval comparisons. Then, we develop a new query containment test for the case where the containing query uses both left and right semi-interval comparisons but with only one left (or right) semi-interval subgoal. Based on this test, we show how to produce an MCR which is a Datalog query with arithmetic comparisons. The containment test that we develop obtains a result of independent interest. It finds another special case where query containment in the presence of arithmetic comparisons can be tested in nondeterministic polynomial time.",
keywords = "Databases, Query languages, Query rewriting",
author = "Foto Afrati and Chen Li and Prasenjit Mitra",
year = "2006",
month = "12",
day = "5",
doi = "10.1016/j.tcs.2006.08.020",
language = "English",
volume = "368",
pages = "88--123",
journal = "Theoretical Computer Science",
issn = "0304-3975",
publisher = "Elsevier",
number = "1-2",

}

TY - JOUR

T1 - Rewriting queries using views in the presence of arithmetic comparisons

AU - Afrati, Foto

AU - Li, Chen

AU - Mitra, Prasenjit

PY - 2006/12/5

Y1 - 2006/12/5

N2 - We consider the problem of answering queries using views, where queries and views are conjunctive queries with arithmetic comparisons over dense orders. Previous work only considered limited variants of this problem, without giving a complete solution. We first show that obtaining equivalent rewritings for conjunctive queries with arithmetic comparisons is decidable. Then, we consider the problem of finding maximally contained rewritings (MCRs) where the decidability proof does not carry over. We investigate two special cases of this problem where the query uses only semi-interval comparisons. In both cases decidability of finding MCRs depends on the query containment test. First, we address the case where the homomorphism property holds in testing query containment. In this case decidability is easy to prove but developing an efficient algorithm is not trivial. We develop such an algorithm and prove that it is sound and complete. This algorithm applies in many cases where the query uses only left (or right) semi-interval comparisons. Then, we develop a new query containment test for the case where the containing query uses both left and right semi-interval comparisons but with only one left (or right) semi-interval subgoal. Based on this test, we show how to produce an MCR which is a Datalog query with arithmetic comparisons. The containment test that we develop obtains a result of independent interest. It finds another special case where query containment in the presence of arithmetic comparisons can be tested in nondeterministic polynomial time.

AB - We consider the problem of answering queries using views, where queries and views are conjunctive queries with arithmetic comparisons over dense orders. Previous work only considered limited variants of this problem, without giving a complete solution. We first show that obtaining equivalent rewritings for conjunctive queries with arithmetic comparisons is decidable. Then, we consider the problem of finding maximally contained rewritings (MCRs) where the decidability proof does not carry over. We investigate two special cases of this problem where the query uses only semi-interval comparisons. In both cases decidability of finding MCRs depends on the query containment test. First, we address the case where the homomorphism property holds in testing query containment. In this case decidability is easy to prove but developing an efficient algorithm is not trivial. We develop such an algorithm and prove that it is sound and complete. This algorithm applies in many cases where the query uses only left (or right) semi-interval comparisons. Then, we develop a new query containment test for the case where the containing query uses both left and right semi-interval comparisons but with only one left (or right) semi-interval subgoal. Based on this test, we show how to produce an MCR which is a Datalog query with arithmetic comparisons. The containment test that we develop obtains a result of independent interest. It finds another special case where query containment in the presence of arithmetic comparisons can be tested in nondeterministic polynomial time.

KW - Databases

KW - Query languages

KW - Query rewriting

UR - http://www.scopus.com/inward/record.url?scp=33750731959&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=33750731959&partnerID=8YFLogxK

U2 - 10.1016/j.tcs.2006.08.020

DO - 10.1016/j.tcs.2006.08.020

M3 - Article

AN - SCOPUS:33750731959

VL - 368

SP - 88

EP - 123

JO - Theoretical Computer Science

JF - Theoretical Computer Science

SN - 0304-3975

IS - 1-2

ER -