Database Provenance Theory
Use semiring annotations to distinguish alternative derivations, joint evidence, multiplicity, and correlated reuse of input tuples.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 3
- Reading time
- 2 min
In this article3 chapters
Join and projection act on explanations
Annotate every input tuple with a variable in the polynomial semiring \(\mathbb N[X]\). In positive relational algebra, union and projection combine alternative derivations by addition, and join combines jointly required inputs by multiplication. For two databases of route legs, suppose a projected connection can be obtained via stop \(a\) using \(r_a,s_a\) or via stop \(b\) using \(r_b,s_b\). Its annotation is
\[ p=r_as_a+r_bs_b. \]
A reader can ask which leg records contributed to a result and which combinations suffice. Repeated variables in a monomial retain the fact that one input was used several times in a derivation, as can happen under a self-join.
In relational algebra, projection groups results that agree on the remaining fields and a join combines compatible inputs. Bag semantics supply the familiar special case where their annotations are counts.
A semiring homomorphism changes the question
Set every variable to one in the natural numbers to obtain multiplicity two for the connection. Map the variables to Boolean values in the Boolean semiring to evaluate availability, where multiplication is conjunction and addition is disjunction. Two derivations that reuse the same input then depend on the same Boolean value. Substituting probabilities directly into ordinary polynomial arithmetic would sum the probabilities of overlapping alternatives. That requires different evaluation, as probabilistic databases show with a shared cause.
The operators determine which provenance applies
The polynomial representation fits positive nonrecursive queries. Difference and negation require a richer account of absences, and recursive queries may need to describe infinitely many derivations or choose a semiring with an appropriate fixed point. A repeated path around a cycle illustrates why reachability and path counting have distinct semantics. In a system that maintains explanations across updates, incremental view maintenance addresses the costs of applying changes. Provenance size can grow faster than the displayed relation, which motivates shared expression graphs or factored representations.[1]