Abstract
Provenance for transactional updates is critical for many applications such as auditing and debugging of transactions. Recently, we have introduced MV-semirings, an extension of the semiring provenance model that supports updates and transactions. Furthermore, we have proposed reenactment, a declarative form of replay with provenance capture, as an efficient and non-invasive method for computing this type of provenance. However, this approach is limited to the snapshot isolation (SI) concurrency control protocol while many real-world applications apply the read-committed version of snapshot isolation (RC-SI) to improve performance at the cost of consistency. We present non-trivial extensions of the model and reenactment approach to be able to compute provenance of RC-SI transactions efficiently. In addition, we develop techniques for applying reenactment across multiple RC-SI transactions. Our experiments demonstrate that our implementation in the GProM system supports efficient reconstruction and querying of provenance.
Introduction
In modern database systems, tracking the history and derivation of data—known as database provenance—is essential for auditing, debugging, and data quality assessment. While provenance for simple queries is well-understood, capturing it for concurrent transactional updates remains a significant challenge. Databases use isolation levels to manage concurrency; a common level is Snapshot Isolation (SI), where a transaction operates on a single consistent snapshot of the database state from its start time.
However, high-performance systems like Oracle and PostgreSQL often default to Read-Committed Snapshot Isolation (RC-SI). In RC-SI, each individual statement within a transaction receives its own fresh snapshot of the most recently committed data. This improves performance by allowing higher concurrency but complicates provenance tracking, as the data versions visible to a transaction can change mid-stream. This paper extends the "reenactment" technique to support the complexities of RC-SI.
The Visibility Challenge in RC-SI
The primary difficulty in RC-SI is the "moving target" of statement-level snapshots. Unlike SI, where a transaction's view of the database is static, an RC-SI transaction might see changes made by concurrent neighbors that committed after the first transaction began.
As shown in the example history above, statements from different transactions (like $T_7$ and $T_8$) can interleave in ways that affect what subsequent statements read. Tracking which specific update led to a current value requires a precise reconstruction of these visibility rules.
Methodology: Reenactment and MV-Semirings
To address this, the authors utilize MV-semirings, a mathematical framework that annotates data rows with their derivation history. To compute these annotations retroactively, they employ a technique called reenactment. Reenactment replays a transaction's logic as a declarative SQL query, instrumented to carry provenance information alongside the data.
This approach is non-invasive, meaning it does not slow down the live database. Instead, it leverages existing audit logs (to identify executed SQL) and time-travel features (to access historical data states) to reconstruct provenance on demand. To handle RC-SI, the authors introduced two key operators:
- Version Merge ($\mu$): Merges different versions of a table while ensuring only the most recent valid version for a given statement is retained.
- Version Filter ($\gamma$): An optimization that filters out row versions that should not be visible to a specific statement based on commit timestamps.
Performance and Optimizations
A naive implementation of RC-SI reenactment would require reading a table from disk for every statement in a transaction, leading to significant overhead. The authors developed a "Read-Once" optimization using the Version Filter, allowing the system to process the entire transaction with a single pass over the data.
Experimental results using the GProM middleware on synthetic datasets (ranging from 10,000 to 1,000,000 rows) show that this optimized approach is nearly as efficient as the simpler SI reenactment. The system scales linearly with data size and history length, successfully processing provenance for transactions with 1,000 updates in just a few seconds.
Conclusion and Future Work
This work successfully bridges the gap between theoretical provenance models and the practical realities of high-performance database isolation. By enabling efficient, declarative provenance capture for RC-SI, it provides a powerful tool for auditing and debugging complex transactional systems. Future research may explore even weaker isolation levels, such as Read Uncommitted, and further optimize reenactment for complex INSERT operations.
Summary updated