[Paper Review] A Simple Algorithm for Consistent Query Answering Under Primary Keys
This paper presents a simple inflationary fixpoint algorithm for consistent query answering (CQA) under primary key constraints. It efficiently determines whether a boolean conjunctive query is certain over an inconsistent database by iteratively expanding sets of facts up to query size k; the algorithm correctly identifies certainty in polynomial time for self-join-free and path queries, and is bounded if and only if query certainty is first-order definable.
We consider the dichotomy conjecture for consistent query answering under primary key constraints. It states that, for every fixed Boolean conjunctive query q, testing whether q is certain (i.e. whether it evaluates to true over all repairs of a given inconsistent database) is either polynomial time or coNP-complete. This conjecture has been verified for self-join-free and path queries. We propose a simple inflationary fixpoint algorithm for consistent query answering which, for a given database, naively computes a set $Δ$ of subsets of facts of the database of size at most k, where k is the size of the query q. The algorithm runs in polynomial time and can be formally defined as: (1) Initialize $Δ$ with all sets $S$ of at most $k$ facts such that $S\models q$. (2) Add any set $S$ of at most k facts to $Δ$ if there exists a block $B$ (i.e., a maximal set of facts sharing the same key) such that for every fact $a \in B$ there is a set $S' \subseteq S \cup \{a\}$ such that $S'\in Δ$. For an input database $D$, the algorithm answers "q is certain" iff $Δ$ eventually contains the empty set. The algorithm correctly computes certainty when the query q falls in the polynomial time cases of the known dichotomies for self-join-free queries and path queries. For arbitrary Boolean conjunctive queries, the algorithm is an under-approximation: the query is guaranteed to be certain if the algorithm claims so. However, there are polynomial time certain queries (with self-joins) which are not identified as such by the algorithm.
Motivation & Objective
- To address the open dichotomy conjecture for consistent query answering under primary keys, which posits that the problem is either in P or coNP-complete.
- To design a simple, efficient algorithm that correctly computes certain answers for tractable classes of conjunctive queries.
- To characterize when the algorithm's under-approximation becomes exact, particularly in relation to first-order definability.
- To extend the algorithm to non-boolean and constant-containing queries while preserving polynomial-time complexity.
- To provide a unified framework that generalizes to other constraint types via conflict hypergraphs.
Proposed method
- Initialize a set ∆ with all subsets S of at most k facts such that S |= q, where k is the size of the query q.
- Iteratively expand ∆ by adding any set S of at most k facts if, for some block B (facts sharing the same key), every fact a ∈ B has a superset S′ ⊆ S ∪ {a} already in ∆.
- The algorithm terminates when no new sets can be added; the query is certain iff the empty set ∅ ∈ ∆.
- The algorithm operates in polynomial time and is formally defined as an inflationary fixpoint process.
- For non-boolean queries, the algorithm checks whether ∆(q, D, ¯a) contains ∅ for each candidate answer ¯a.
- The algorithm can be adapted to include constants by fixing their interpretation and reducing iterations to one when no free variables remain.
Experimental results
Research questions
- RQ1For which classes of conjunctive queries does the proposed fixpoint algorithm correctly compute all certain answers?
- RQ2Under what conditions is the algorithm's under-approximation exact, i.e., when does it correctly identify all certain queries?
- RQ3When is the certainty of a conjunctive query first-order definable, and how does this relate to the boundedness of the fixpoint algorithm?
- RQ4Can the algorithm be generalized to other types of integrity constraints beyond primary keys?
- RQ5Is it possible to achieve lower computational complexity (e.g., LogSpace) for self-join-free queries using a simplified variant of this algorithm?
Key findings
- The algorithm correctly computes certainty for all self-join-free conjunctive queries that are tractable under the known dichotomy, i.e., those satisfying the PCond condition.
- For path queries, the algorithm correctly identifies all certain queries when the query is tractable, and the algorithm's boundedness corresponds exactly to first-order definability of query certainty.
- The algorithm is an under-approximation for general conjunctive queries: if it outputs 'certain', then the query is indeed certain, but it may miss some polynomial-time certain queries with self-joins.
- The fixpoint algorithm is bounded (i.e., terminates in a finite number of steps independent of the database size) if and only if the query's certainty is first-order definable.
- The algorithm can be extended to non-boolean queries and queries with constants while preserving polynomial-time complexity in data complexity.
- The conflict hypergraph generalization suggests that the algorithm's structure naturally extends to other constraint types, such as denial constraints or key constraints.
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.