Incremental Join Deltas for Inserts and Deletes
Update a materialized equijoin by matching changed tuples against existing data and account for changes on both sides.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A deletion removes one contribution per match
Under bag semantics, represent a delete as weight minus one. If one left occurrence is removed and its key matches two right occurrences, the view receives two negative contributions, even if those outputs are identical and combine to weight minus two. Looking up matching rows by key can replace recomputing a join over both full inputs.
Simultaneous changes add a cross term
Using old inputs \(R,S\), the full change includes \(\Delta R\Join S\), \(R\Join\Delta S\), and \(\Delta R\Join\Delta S\). To see why, start with empty inputs and insert one matching row on each side. The first two contributions vanish and the cross term produces the new pair. Sequential processing obtains it by using one updated input. Bag semantics justify multiplication of counts. Differential maintenance generalizes this reasoning to richer timestamped computations.[1][2]