Skip to content
About
Main content

The anomalies are three shapes, not five concepts

How does counting edges give the isolation levels?

Textbooks list , , , and as five separate hazards. If you derive them from the graph instead of listing them, they collapse into a few shapes.

Shape in the
A cycle of ww edges only (Adya's name: G0)
Dirty read (aborted)Reading a version whose writer later aborted (G1a)
Intermediate readReading a version that its writer overwrote before committing (G1b)
Circular information flowA cycle of ww and wr edges (G1c)
Non-repeatable readA cycle with exactly one rw edge, on one item
A cycle with exactly one rw edge, across two items
Lost updateA cycle with one rw edge and a ww edge, on the same item
PhantomA cycle with an rw edge whose "item" is a
Write skewA cycle with two or more rw edges (G2-item)

Short definitions of the terms you have not seen:

  • Dirty write: T1 and T2 write the same row before either , and their writes interleave so that no order is coherent.
  • Dirty read: reading a value that another transaction has written but not committed (and which may be rolled back).
  • Non-repeatable read: reading the same row twice in a transaction and getting two values.
  • Read skew: reading two related rows and seeing them at two different moments. Example: you read main before a transfer and savings after it, so the total looks wrong. It is different from a non-repeatable read, and it is the one that corrupts reports.
  • Lost update: two read-modify-write cycles on the same row, and one overwrites the other.
  • Phantom: a repeated query such as WHERE amount > 100 returns a new row that another transaction inserted.
  • Write skew: two transactions read overlapping data, each writes a different row, and together they break a rule that either alone would keep.

Non-repeatable read, read skew and lost update are the same shape. That is why a level either permits all three or forbids all three. It is also why the usual textbook treatment as three separate hazards misleads. Write skew is not a stranger either. It is the same family with the number of rw edges raised by one.

Counting gives the levels

The shapes give the levels directly:

Forbid cycles with…Level
zero rw edges (no G1)Read Committed
one or fewer rw edges
any number of item rw edges (Adya's PL-2.99)
any rw edges, predicates included (PL-3)

Read that list twice.

  • Repeatable Read is serializable minus predicate anti-dependencies. The gap between them is exactly phantoms, nothing else.
  • SI and RR are not ordered. SI forbids a one-rw cycle that RR permits, when the edge is predicate-based. RR forbids a two-rw item cycle (write skew) that SI permits. Two levels, neither stronger. Yet the standard presents them as adjacent rungs of one ladder.