English

A Simple Algorithm for Consistent Query Answering under Primary Keys

Databases 2025-02-26 v7 Logic in Computer Science

Abstract

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 Δ\Delta 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 Δ\Delta with all sets SS of at most kk facts such that SqS\models q. (2) Add any set SS of at most k facts to Δ\Delta if there exists a block BB (i.e., a maximal set of facts sharing the same key) such that for every fact aBa \in B there is a set SS{a}S' \subseteq S \cup \{a\} such that SΔS'\in \Delta. For an input database DD, the algorithm answers "q is certain" iff Δ\Delta 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.

Keywords

Cite

@article{arxiv.2301.08482,
  title  = {A Simple Algorithm for Consistent Query Answering under Primary Keys},
  author = {Diego Figueira and Anantha Padmanabha and Luc Segoufin and Cristina Sirangelo},
  journal= {arXiv preprint arXiv:2301.08482},
  year   = {2025}
}
R2 v1 2026-06-28T08:16:02.651Z