Conjunctive query containment revisited
We consider the problems of conjunctive query containment and minimization, which are known to be NP-complete, and show that these problems can be solved in polynomial time for the class of acyclic queries. We then generalize the notion of acyclicity and define a parameter called query width that ca...
Saved in:
Published in | Theoretical computer science Vol. 239; no. 2; pp. 211 - 229 |
---|---|
Main Authors | , |
Format | Journal Article |
Language | English |
Published |
Elsevier B.V
28.05.2000
|
Online Access | Get full text |
Cover
Loading…
Summary: | We consider the problems of conjunctive query containment and minimization, which are known to be NP-complete, and show that these problems can be solved in polynomial time for the class of
acyclic queries. We then generalize the notion of acyclicity and define a parameter called
query width that captures the “degree of cyclicity” of a query: in particular, a query is acyclic if and only if its query width is 1. We give algorithms for containment and minimization that run in time polynomial in
n
k
, where
n is the input size and
k is the query width. These algorithms naturally generalize those for acyclic queries, and are of practical significance because many queries have small query width compared to their sizes. We show that good bounds on the query width of
Q can be obtained using the
treewidth of the incidence graph of
Q. We then consider the problem of finding an equivalent query to a given conjunctive query
Q that has the least number of subgoals. We show that a polynomial-time approximation algorithm is unlikely for this problem. Finally, we apply our containment algorithm to the practically important problem of finding equivalent rewritings of a query using a set of materialized views. |
---|---|
ISSN: | 0304-3975 1879-2294 |
DOI: | 10.1016/S0304-3975(99)00220-0 |