GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 46

Build the transaction precedence graph

Database Management Systems · Transactions & Concurrency Control · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q46 2 marks · MSQ
Report issue

Transactions & Concurrency Control

Question 46, GATE 2024: The schedule is r1(z); w1(z); r2(x); r3(y); w3(y); r2(y); w2(x); w2(y), where subscripts name transactions. Which serial schedules are conflict equivalent? A T1 T2 T3; B T1 T3 T2; C T3 T2 T1; D T3 T1 T2.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C, D

Step through it (10 steps)

Approach: Only operations from different transactions on the same data item, with at least one write, impose conflict-order constraints.
1. Transaction T1 touches only z. Neither T2 nor T3 uses z, so T1 has no conflicts with the others and may appear anywhere in a serial order.
2. Only T2 accesses x, so x creates no intertransaction constraint.
3. On y, T3's read and write precede T2's read and write. Conflicting pairs include w3(y) before r2(y), w3(y) before w2(y), and r3(y) before w2(y). Each demands the same precedence edge T3→T2.
4. A conflict-equivalent serial order must therefore put T3 before T2, with T1 free. The valid orders are T1 T3 T2, T3 T2 T1, and T3 T1 T2.
Answer: B, C and D. Option A reverses the y-conflict order. Merely knowing that the precedence graph is acyclic establishes serializability; enumerating its topological orders identifies the actual choices.

Original paper, page 29 · Answer key