CS FundamentalsVery hardGATE CS (PYQ pattern)

T1: R(A), W(A), R(B) and T2: R(B), W(B), R(A), each in that order. Of the C(6,3) = 20 interleavings, how many are conflict-serializable?

  1. A. 8
  2. B. 2
  3. C. 20
  4. D. 10

Correct answer: A. 8

T1 -> T2 needs T1's W(A) before T2's R(A) or T1's R(B) before T2's W(B); T2 -> T1 is the reverse. A cycle arises when T2's W(B) precedes T1's R(B) while T1's W(A) precedes T2's R(A) (or the mirror case). Enumerating the 20 interleavings leaves 8 acyclic ones; the two serial schedules are only part of them.

More DBMS and SQL questions

Exams that ask this topic