Skip to main content
QUICK REVIEW

[Paper Review] Consistent Query Answering for Primary Keys and Conjunctive Queries with Counting

Amezian El Khalfioui, Aziz, Jef Wijsen|arXiv (Cornell University)|Aug 25, 2022
Data Quality and ManagementDecision Sciences1 citations
TL;DR

This paper introduces LinCQA, a system that enables linear-time consistent query answering (CQA) for a class of acyclic SPJ queries with primary keys by leveraging pair-pruning join trees (PPJTs). It provides SQL and Datalog rewritings that guarantee linear-time evaluation, outperforming existing CQA systems by orders of magnitude on synthetic and real-world workloads, especially under high inconsistency or large data sizes.

ABSTRACT

Most data analytical pipelines often encounter the problem of querying inconsistent data that violate pre-determined integrity constraints. Data cleaning is an extensively studied paradigm that singles out a consistent repair of the inconsistent data. Consistent query answering (CQA) is an alternative approach to data cleaning that asks for all tuples guaranteed to be returned by a given query on all (in most cases, exponentially many) repairs of the inconsistent data. This paper identifies a class of acyclic select-project-join (SPJ) queries for which CQA can be solved via SQL rewriting with a linear time guarantee. Our rewriting method can be viewed as a generalization of Yannakakis's algorithm for acyclic joins to the inconsistent setting. We present LinCQA, a system that can output rewritings in both SQL and non-recursive Datalog rules for every query in this class. We show that LinCQA often outperforms the existing CQA systems on both synthetic and real-world workloads, and in some cases, by orders of magnitude.

Motivation & Objective

  • To address the inefficiency and lack of theoretical guarantees in existing consistent query answering (CQA) systems for inconsistent databases.
  • To identify a tractable class of acyclic SPJ queries where CQA can be solved in linear time with guaranteed performance.
  • To design and implement a system that generates efficient, correct SQL and Datalog rewritings for consistent answers without relying on NP-hard solvers.
  • To demonstrate that the proposed method scales robustly under varying data sizes and inconsistency ratios, outperforming state-of-the-art CQA systems.

Proposed method

  • Introduces the concept of a pair-pruning join tree (PPJT), a structural condition on join queries that ensures first-order rewritability and linear-time evaluation.
  • Develops a rewriting algorithm that transforms a query with a PPJT into an equivalent SQL or non-recursive Datalog query that computes consistent answers directly on the inconsistent database.
  • Extends Yannakakis’s algorithm for acyclic joins to the inconsistent setting by incorporating primary key constraints and pruning inconsistent tuples via join tree structure.
  • Implements LinCQA as a system that supports both SQL and Datalog output, enabling integration with standard DBMS and Datalog engines.
  • Employs a novel characterization of acyclic self-join-free SPJ queries that admit linear-time CQA based on structural properties of the attack graph.
  • Validates the correctness and efficiency of the rewriting through theoretical analysis and extensive experiments on synthetic and real-world workloads.

Experimental results

Research questions

  • RQ1Can consistent query answering be performed in linear time for a meaningful class of acyclic SPJ queries with primary key constraints?
  • RQ2Is there a structural condition on SPJ queries that guarantees first-order rewritability and linear-time evaluation in the presence of inconsistent data?
  • RQ3Can such a condition be leveraged to generate efficient, correct SQL or Datalog rewritings that avoid NP-hard solvers?
  • RQ4How does the performance of the proposed system compare to existing CQA systems under varying data sizes and inconsistency ratios?
  • RQ5Is the proposed method robust to high inconsistency ratios and large-scale data, especially when other systems degrade significantly?

Key findings

  • LinCQA achieves linear-time consistent query answering for queries with a pair-pruning join tree (PPJT), with theoretical guarantees on runtime.
  • On synthetic workloads, LinCQA outperforms ConQuer and FastFO by up to two orders of magnitude, especially under high inconsistency ratios.
  • For queries with varying relation sizes, LinCQA’s performance is significantly less sensitive than ConQuer and FastFO, demonstrating superior scalability.
  • LinCQA maintains stable performance across increasing inconsistency ratios, while ConQuer and FastFO show increasing runtime, indicating robustness to data inconsistency.
  • In experiments with StackOverflow-derived queries, LinCQA achieved sub-second response times even on large databases with high inconsistency, while other systems timed out or scaled poorly.
  • The system successfully handles complex join patterns involving partial composite keys and mixed key/non-key joins—common in snowflake schemas and entity matching—where prior systems like Cforest fail.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.