Conflict Serializability and Precedence Graphs

Build ordering edges from conflicting accesses and use a graph cycle to certify that no conflict-equivalent serial order exists.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Two operations conflict if their order can affect a shared item
  2. Two independent writes can still create a cycle

Two operations conflict if their order can affect a shared item

For separate transactions, a read and a write of the same item conflict, as do two writes. Two reads do not. For each conflicting pair in the schedule, draw an edge from the earlier transaction to the later one. A topological ordering of the graph gives a serial schedule with the same conflicting orders. An ordering cycle prevents any such serial schedule.

Two independent writes can still create a cycle

Let transaction one read \(y\), transaction two read \(x\), then one write \(x\) and two write \(y\). The read of \(x\) requires two before one, and the read of \(y\) requires one before two. Their writes target different items, yet the graph cycles. Topological ordering explains the witness criterion. Two-phase locking prevents such conflict cycles under its locking model.[1][2]

References

  1. Hal Berenson et al., A Critique of ANSI SQL Isolation Levels ↩
  2. CMU 15-445/645, Introduction to Database Systems: Lectures ↩