PUG: a framework and practical implementation for why and why-not provenance

Seokki Lee, Bertram Ludäscher, Boris Glavic · DOI

TL;DR

This paper introduces PUG, a system that provides explanations for why a query returns (or doesn't return) specific results, even for complex queries involving negation. PUG uses a novel graph-based provenance model and can generate concise, factorized explanations, outperforming existing methods in efficiency and expressiveness.

What Problem Does This Paper Address?

In data management, understanding why a query produces a certain result (or fails to produce one) is crucial for debugging, auditing, and gaining insights. While "why" provenance (explaining existing results) has been studied, "why-not" provenance (explaining missing results) is more challenging, especially for queries with negation. Existing approaches often treat these two problems separately. This paper tackles the unified problem of explaining both why and why-not for first-order queries with negation, aiming for a practical and efficient solution.

Methods

The core of PUG is a novel graph-based provenance model. This model represents query evaluation as a graph where nodes represent rules, goals, and data tuples, colored to indicate success or failure. This graph structure naturally supports "reverse reasoning," allowing users to ask "what-if" questions.

Key techniques include:

  • Provenance Unification through Graphs (PUG): A system that takes a Datalog query and a provenance question (e.g., "Why is tuple X missing?") as input.
  • Datalog Rewriting: The input Datalog program is rewritten to generate "firing rules" that capture successful and failed rule derivations.
  • Provenance Graphs: The rewritten program generates a graph that visually explains the provenance.
  • Factorization: PUG can rewrite queries to produce more compact, factorized provenance representations, significantly reducing the size of explanations.
  • Semiring Provenance Integration: The model is shown to be equivalent to various semiring provenance models, demonstrating its expressiveness.

Datasets

The paper evaluates PUG using:

  • DBLP dataset: Used for co-author graph analysis, with subsets ranging from 100 to 8 million co-author pairs.
  • TPC-H benchmark: Used with database sizes from 10MB to 10GB.

Key Insights and Ideas

  • Unified Why/Why-Not: The graph-based model elegantly handles both existing and missing results, bridging a gap in previous work.
  • Reverse Reasoning: The provenance graphs can be used to explore hypothetical scenarios (e.g., "What if this fact were different?").
  • Factorization for Conciseness: Rewriting queries to exploit common subexpressions dramatically reduces the size of provenance explanations, making them more manageable.
  • Practical Implementation: The system is implemented as a middleware (PUG) built on top of GProM, leveraging existing database backends (Postgres, Oracle) for efficient execution.

Key Results

  • Efficiency: PUG significantly outperforms existing "Direct Method" (DM) approaches for provenance games, especially for queries with more variables or larger datasets. For instance, DM failed to complete within 10 minutes for datasets larger than 10K tuples, while PUG scaled much better.
  • Expressiveness: PUG's model is proven to be equivalent to provenance games and can encode various semiring provenance models, including those for first-order logic.
  • Factorization Benefits: Factorized explanations can be exponentially more concise than flat representations, with performance gains observed in experiments. For example, for the suppCust query, factorized explanations were significantly smaller and faster to generate.
  • Handling Negation: PUG effectively handles queries with negation, demonstrating comparable performance to non-negated queries.

Limitations and Future Work

  • Aggregation: The current framework does not support aggregation queries.
  • Summarization: While factorization offers conciseness, further work on provenance summarization is suggested to handle very large explanations.
  • More Expressive Languages: Future work could extend the approach to support more expressive query languages, such as those with aggregation.
  • Interactive Exploration: The authors mention the potential for interactive exploration of provenance graphs.

Summary updated

BibTeX
@article{lee2019pug,
  author = {Seokki Lee and Bertram Ludäscher and Boris Glavic},
  title = {{PUG: a framework and practical implementation for why and why-not provenance}},
  journal = {VLDB J.},
  year = {2019},
  doi = {10.1007/s00778-018-0518-5},
}
Figure