The Complexity of Finding Missing Answer Repairs
Jesse Comer, Val Tannen
TL;DR
This work analyzes the computational complexity of repairing databases to ensure a missing tuple becomes part of a query's answer, introducing four problem variants ($MA_{dec}$, $MA_{bound}$, $MA_{size}$, $MA_{min}$) under both combined and data complexity. It develops a comprehensive taxonomy across query classes from UCQ$_{\lnot}$, CQ$_{\lnot}$, and datalog families, showing a tractability boundary: data complexity is polynomial for semi-positive datalog, while combined complexity ranges from $P$ to $NP$-hard, $OptP[\log(n)]$-hard, to $EXP$ and beyond for stronger languages like Datalog/sp-Datalog, with relational-algebra queries ($RA$) becoming undecidable. A central technical contribution is the unfolding theorem that expresses sp-Datalog programs as (possibly infinite) unions of CQ$_{\lnot}$ queries, enabling polynomial-time minimal-repair computation in data complexity. The paper also introduces bounded repairs and generic-query notions to bound search spaces, clarifying practical implications for view updates and data cleaning, and suggests broad avenues for extending the theory to semirings and universal-quantification-framed constraints.
Abstract
We investigate the problem of identifying database repairs for missing tuples in query answers. We show that when the query is part of the input - the combined complexity setting - determining whether or not a repair exists is polynomial-time is equivalent to the satisfiability problem for classes of queries admitting a weak form of projection and selection. We then identify the sub-classes of unions of conjunctive queries with negated atoms, defined by the relational algebra operations permitted to appear in the query, for which the minimal repair problem can be solved in polynomial time. In contrast, we show that the problem is NP-hard, as well as set cover-hard to approximate via strict reductions, whenever both projection and join are permitted in the input query. Additionally, we show that finding the size of a minimal repair for unions of conjunctive queries (with negated atoms permitted) is OptP[log(n)]-complete, while computing a minimal repair is possible with O($n^2$) queries to an NP oracle. With recursion permitted, the combined complexity of all of these variants increases significantly, with an EXP lower bound. However, from the data complexity perspective, we show that minimal repairs can be identified in polynomial time for all queries expressible as semi-positive datalog programs.
