In-memory Incremental Maintenance of Provenance Sketches [extended version]

Pengyuan Li, Boris Glavic, Dieter Gawlick, Vasudha Krishnaswamy, Zhen Hua Liu, Danica Porobic, Xing NiuarXiv 2025 · DOI

Overview

Provenance-based data skipping (PDBS) is a powerful technique that allows databases to bypass irrelevant data fragments during complex query execution. By using compact bitvectors called "sketches," systems can identify which parts of a table contribute to a result. However, these sketches are brittle; any update to the underlying data renders them stale. Re-computing sketches from scratch is often prohibitively expensive. This paper presents IMP (Incremental Maintenance of Provenance Sketches), a framework designed to maintain these sketches in-memory by processing only data changes (deltas), achieving speedups of up to four orders of magnitude.

The Challenge of Stale Sketches

Standard database pruning methods like indexing often fail for queries with non-trivial predicates, such as TOP-K or HAVING clauses, where relevance is only determined at runtime. PDBS addresses this by recording provenance at a coarse-grained level (data fragments). The primary bottleneck is maintenance: in dynamic environments, the cost of re-capturing provenance can exceed the cost of the original query.

The IMP Framework

IMP acts as a middleware layer that intercepts updates and incrementally updates provenance sketches without full re-computation.

The IMP architecture integrates with existing databases to handle query parsing, rewriting, and incremental maintenance using an in-memory engine.

Incremental Annotated Semantics

The core of IMP is its ability to process "annotated deltas." Instead of treating updates as raw tuples, IMP pairs them with metadata identifying the data fragments they affect.

Example of annotated relations and a delta update used by IMP to track provenance changes across data ranges.

Key components include:

  • Incremental Operators: Redesigned SQL operators (Join, Aggregation, etc.) that maintain internal state (e.g., per-group counts in a SUM) to reflect how specific fragments contribute to the current result.
  • In-Memory Engine: Uses specialized structures like HashMaps and Balanced Search Trees to manage operator state efficiently in RAM.
  • Optimizations: IMP employs Bloom filters to prune updates that don't participate in joins and pushes selection filters down into delta-fetching queries to minimize processing overhead.

Experimental Evaluation

The authors evaluated IMP using TPC-H benchmarks, the Chicago Crime dataset, and synthetic microbenchmarks.

  • Performance: On TPC-H, IMP outperformed full re-capture by 3.9x to 2,497x. For real-world crime data, it was consistently two orders of magnitude faster for typical update sizes.
  • Scalability: Performance scales with the size of the update rather than the total database size, making it ideal for large-scale dynamic datasets.
  • Break-Even Point: Incremental maintenance remains the superior strategy until updates reach approximately 3.5% to 5.5% of the total data volume, at which point full re-computation becomes more efficient.

Conclusion

IMP makes provenance-based data skipping practical for real-time, update-heavy workloads. By shifting the maintenance burden to an efficient in-memory incremental engine, it allows databases to retain the performance benefits of data skipping even as the underlying data evolves. Future work aims to expand operator support and introduce cost-based optimization to automatically toggle between incremental and full maintenance.

Summary updated

BibTeX
@misc{li2025memory,
  author = {Pengyuan Li and Boris Glavic and Dieter Gawlick and Vasudha Krishnaswamy and Zhen Hua Liu and Danica Porobic and Xing Niu},
  title = {{In-memory Incremental Maintenance of Provenance Sketches [extended version]}},
  year = {2025},
  eprint = {2505.20683},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.20683},
}
Figure