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).
翻译:本文研究了重写问题,即对于给定的合取查询 $Q$ 和一组视图 $\mathcal{V}$,是否存在 $\mathcal{V}$ 上的合取查询 $Q'$ 等价于 $Q$ 的判定问题,特别针对查询、视图以及/或期望的重写是无环或更受限制的情况。研究表明,如果 $Q$ 本身是无环的,那么只要存在任何重写,就必然存在无环重写。类似的结论也适用于自由连接无环、层次化及 q-层次化查询。关于重写问题的复杂度,本文识别了该问题的易处理变体与(推测)难处理变体之间的边界:在有限元数模式中,即使查询 $Q$ 和视图集 $\mathcal{V}$ 均为无环或层次化,无环重写问题仍是 NP 困难的。然而,当视图为自由连接无环时(即简而言之,其主体 (i) 是无环的,且 (ii) 在将头部作为附加原子添加后仍保持无环),该问题变得易处理。