[Paper Review] Rewriting with Acyclic Queries: Mind Your Head
This paper investigates the existence and complexity of acyclic rewritings for conjunctive queries over materialized views. It proves that if a rewriting exists for an acyclic, free-connex acyclic, hierarchical, or q-hierarchical query, then an acyclic rewriting also exists—making efficient evaluation possible. The problem becomes NP-complete when view arity is unbounded, even with bounded schema arity, but is tractable when views have bounded arity or are free-connex acyclic.
The paper studies the rewriting problem, that is, the decision problem whether, for a given conjunctive query $Q$ and a set $\mathcal{V}$ of views, there is a conjunctive query $Q'$ over $\mathcal{V}$ that is equivalent to $Q$, for cases where the query, the views, and/or the desired rewriting are acyclic or even more restricted. It shows that, if $Q$ itself is acyclic, an acyclic rewriting exists if there is any rewriting. An analogous statement also holds for free-connex acyclic, hierarchical, and q-hierarchical queries. Regarding the complexity of the rewriting problem, the paper identifies a border between tractable and (presumably) intractable variants of the rewriting problem: for schemas of bounded arity, the acyclic rewriting problem is NP-hard, even if both $Q$ and the views in $\mathcal{V}$ are acyclic or hierarchical. However, it becomes tractable if the views are free-connex acyclic (i.e., in a nutshell, their body is (i) acyclic and (ii) remains acyclic if their head is added as an additional atom).
Motivation & Objective
- To determine under which conditions an acyclic rewriting exists whenever a standard rewriting exists.
- To analyze the computational complexity of the acyclic rewriting decision problem under various structural constraints on queries and views.
- To identify tractable fragments of the rewriting problem by restricting view and schema arities.
- To explore the role of structural properties like free-connexity and hierarchy in enabling efficient query rewriting.
- To establish a boundary between tractable and intractable variants of the rewriting problem in the context of acyclic queries.
Proposed method
- Introduces a new characterization of exact rewritability using cover descriptions and atom set partitions.
- Applies the canonical rewriting approach to construct acyclic rewritings efficiently when they exist.
- Uses transformations of cover descriptions to reduce complex rewriting problems to simpler, equivalent forms.
- Employs structural analysis of query plans and view dependencies to prove closure properties under acyclicity.
- Leverages known complexity results from query evaluation (e.g., constant-delay enumeration) to derive hardness bounds.
- Analyzes the impact of view arity and schema arity on the complexity of the rewriting problem.
Experimental results
Research questions
- RQ1Under what conditions does the existence of a rewriting imply the existence of an acyclic rewriting?
- RQ2What is the computational complexity of deciding whether an acyclic rewriting exists for a given query and view set?
- RQ3How does bounded view arity affect the tractability of the acyclic rewriting problem?
- RQ4Is the rewriting problem tractable when views are free-connex acyclic, even with unbounded schema arity?
- RQ5Can the results be extended to other efficiently evaluable query classes, such as bounded-treewidth conjunctive queries?
Key findings
- If a conjunctive query Q is acyclic, then any rewriting of Q over a view set V is equivalent to an acyclic rewriting, meaning efficient evaluation is always possible when a rewriting exists.
- The same closure property holds for free-connex acyclic, hierarchical, and q-hierarchical queries: if a rewriting exists, then an equivalent rewriting in the same class also exists.
- The acyclic rewriting problem is NP-complete when view arity is unbounded, even if both the query and views are acyclic and the schema has bounded arity (e.g., Rewr3(ACQ, ACQ, ACQ) is NP-complete).
- The problem becomes tractable (in polynomial time) when view arity is bounded by a constant, even if the schema arity is unbounded.
- The problem is also tractable when views are free-connex acyclic, regardless of schema arity, indicating that free-connexity is a key structural constraint for tractability.
- The results imply that for queries in ACQ, CCQ, HCQ, or QHCQ, the complexity of Rewr(V, Q, CQ) coincides with that of Rewr(V, Q, Q), simplifying complexity analysis.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.