Skip to content
C

View Serializability


View Serializability

Definition

Two schedules are view equivalent if all three of these hold:

  1. Same initial reads: for each data item, if some transaction reads its initial (pre-schedule) value in one schedule, the same transaction reads the initial value of that item in the other schedule.
  2. Same read-from relationships: if transaction Tj reads a value of item X that was written by Ti in one schedule, then Tj must read the value of X written by that same Ti in the other schedule too.
  3. Same final writes: for each data item, the transaction that performs the last write to it must be the same in both schedules.

A schedule is view-serializable if it is view-equivalent to some serial schedule.

Every Conflict-Serializable Schedule Is View-Serializable — But Not Vice Versa

Conflict serializability is a stricter (narrower) test than view serializability: reordering via non-conflicting swaps always preserves the same initial-reads/read-from/final-writes structure, so every conflict-serializable schedule automatically qualifies as view-serializable. The interesting case is the reverse: schedules that are view-serializable but not conflict-serializable. These always involve blind writes — a write to an item with no read of that item by the same transaction beforehand.

Worked Example — View-Serializable but NOT Conflict-Serializable

Consider three transactions all touching data item A: T1 does R(A) then later W(A); T2 does only W(A) (a blind write); T3 does only W(A) (a blind write). Schedule:

1. R1(A)   2. W2(A)   3. W1(A)   4. W3(A)

Conflict analysis: R1(A) before W2(A) → T1→T2. W2(A) before W1(A) → T2→T1. That's already a cycle (T1→T2 and T2→T1), so this schedule is NOT conflict-serializable.

View analysis: Compare against serial schedule <T1, T2, T3>.

  • Initial reads: in both schedules, only T1 reads A, and it reads the pre-schedule initial value (nobody writes A before R1(A) in either). ✓ Match.
  • Read-from: no transaction reads a value written by another transaction in either schedule (T1's only read is the initial value; T2 and T3 never read at all). ✓ Match (vacuously).
  • Final write: in the original schedule, the last write is W3(A) — T3. In <T1, T2, T3>, the last write is also T3's. ✓ Match.

All three conditions hold, so the schedule is view-equivalent to `<T1, T2, T3>` — it is view-serializable, despite failing the conflict-serializability test. Intuitively: since nobody ever reads the intermediate values written by T2 or T1, the actual order of those blind writes doesn't matter to any observer — only the final writer (T3) matters, and that matches.

Why Real Systems Still Check Conflict Serializability

View serializability is strictly more permissive (a larger class of "safe" schedules) but testing it in general is computationally much harder (NP-complete) than testing conflict serializability (which reduces to cycle-detection on a precedence graph, 23.6 — polynomial time). Because of this, virtually every production DBMS's concurrency control protocol enforces the narrower, cheaper-to-guarantee conflict serializability, quietly giving up the extra (rare, blind-write-dependent) concurrency that view serializability would technically allow.

Edge Cases

  • If a schedule has no blind writes at all, conflict serializability and view serializability coincide exactly — the distinction only matters when blind writes are present.
  • View serializability is about the netresult being indistinguishable, not about the physical order of operations — this is why it's the "true" theoretical notion of correctness, even though it's impractical to test directly at scale.

Key Takeaways / Interview Angle

  • Q: Is view serializability strictly broader than conflict serializability? Yes — every conflict-serializable schedule is view-serializable, but some view-serializable schedules are not conflict-serializable (always involving blind writes).
  • Q: Why don't production databases test view serializability directly? Because it's NP-complete to test in general, versus conflict serializability's efficient polynomial-time (precedence-graph cycle) test.

Mock Test

  • View Serializability - Quick Test

    8 questions on View Serializability.

    8 questions · 8 min · Medium
    Start Mock Test