This paper studies the consistent query answering problem for Boolean self-join-free conjunctive queries under single-primary-key and acyclic attack-graph constraints, from the less-studied perspective of combined complexity, proving that when the number of source strongly connected components in the query's key-non-key graph is bounded, the problem is decidable in polynomial time, while in the unbounded case the problem is Π₂-complete.
Consistent query answering (CQA) provides a principled semantics for queries over inconsistent databases, typically defined through the notions of repairs and consistent answers. A repair r of a database db is a consistent database as close to db as possible; under primary key constraints or more generally functional dependencies, the repair r is a subset of db that is ⊆-minimal with respect to the symmetric difference r⊕db. For a query q(⃗x), an answer ⃗a is a consistent answer if and only if it belongs to the output q(r) of the query q on every repair r of db.
Since the number of repairs can grow exponentially with the size of the database, CQA is generally computationally intractable, even for conjunctive queries (CQs). Unlike ordinary conjunctive query evaluation, this intractability already arises in the data-complexity setting, where the query and constraint set are fixed and only the database is input; indeed, there exist Boolean conjunctive queries with atoms over only two distinct relation symbols whose CQA problem is coNP-hard.
For the class of sjfBCQ queries, the existing data-complexity classification in the field yields a clear trichotomy: if the query's attack graph is acyclic, then CERTAINTY(q) is in the FO complexity class; if the attack graph contains cycles but no strong cycles, then CERTAINTY(q) is L-complete; if the attack graph contains strong cycles, then CERTAINTY(q) is coNP-complete.
The paper's first core complexity result concerns self-join-free Boolean conjunctive queries satisfying a single-primary-key constraint whose attack graph is acyclic: when the number of source strongly connected components in the query's key-non-key graph is constrained by an arbitrary fixed constant c, the combined complexity of the consistent query answering problem for this class of queries is polynomial time.
The second core result establishes the strictness of the above polynomial-time boundary: once the boundedness constraint on the number of source strongly connected components of the key-non-key graph is removed, the combined complexity of consistent query answering over all Boolean conjunctive queries satisfying single-primary-key, self-join-free, and acyclic-attack-graph conditions rises to -complete.
To prove the main polynomial-time result, the paper introduces a series of specially designed core constructions. First is the database saturation mechanism, which through a set of local relevance checks directly removes all blocks in the database irrelevant to the current query, substantially shrinking the instance size to be handled in subsequent steps. Immediately following, the query saturation operation adds, between any two distinct variables of the query, as many bivariate atoms of the form , as possible, while adding corresponding consistent relations in the database for these new relation names, fully aligning the structures of the database and query to avoid missing potential attack propagation paths in later reductions. The figure below allows you to intuitively observe the position of the saturation operation in the overall pipeline and the state changes before and after.
Regarding the correctness and complexity bound of the saturation operation, the paper provides a formal proof of the Saturation Lemma: for the class of all (db, q) instances whose database is q-saturated, there exists a fixed constant c such that each saturation step is an equivalence-preserving, SCC-monotone, c-controlled polynomial-time reduction. This property guarantees that saturation never changes the consistent query answering result of the original problem while introducing no extra computational overhead beyond polynomial range.
After completing the saturation of the database and query, the next step is query normalization, whose core design goal is to completely separate consistent and inconsistent edges in the query, ensuring each atom generates only a single type of edge and clearing structural obstacles for subsequent reduction steps. The corresponding Normalization Lemma further validates the effectiveness of this operation: for all saturated databases and saturated queries, normalization is likewise an equivalence-preserving, SCC-monotone polynomial-time reduction; if the output does not directly yield a Boolean constant result, the final query will fully satisfy all the structural constraints of normalization.
The paper's main lemma states that, for any natural number c, for the class C consisting of all (database, query) pairs where the database is q-saturated, the query is a saturated and normalized query from , and the number of source strongly connected components of the query's dependency graph does not exceed c, the Solve operation is an equivalence-preserving polynomial-time reduction mapping all instances in this class to the Boolean set {true, false}. The figure that follows allows you to fully understand the three-step core transformation logic of this reduction and the officially defined variable meanings.
Based on the polynomial-time reduction property of the main lemma, when the number of source strongly connected components of the query's dependency graph does not exceed the preset constant c, deciding whether the transformed database and transformed query belong to the CERTAINTY set can be done in polynomial time, and by composing the reduction steps the CERTAINTY problem of the original query can be directly shown to be solvable in polynomial time overall.
The core results of this study do not provide a complete complexity dichotomy, and a gap remains uncovered; whether this gap can be filled or further tightened is the first open follow-up question raised by the authors.
All techniques introduced in the current study are built on the single-primary-key restriction, which is the core applicability prerequisite; whether the relevant methods can be extended to the compound-primary-key setting remains open and has not yet been verified.
The cases covered in this study only cover the first-order-rewritable part of the data complexity; whether the relevant techniques can be extended to arbitrary self-join-free queries tractable in data complexity has not been verified, which is also a worthwhile direction for future exploration.