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-hard 的。然而,当视图是自由连通无环时(即,简言之,其查询体的(i)是无环的,且(ii)在将其头部作为附加原子添加后仍保持无环),该问题则成为易处理的。