GATE | GATE CS 2021 | Set 2 | Question 42
Let S be the following schedule of operations of three transactions T1, T2 and T3 in a relational database system:
R2(Y),R1(X),R3(Z),R1(Y)W1(X),R2(Z),W2(Y),R3(X),W3(Z)
Consider the statements P and Q below:
- P: S is conflict-serializable.
- Q: If T3 commits before T1 finishes, then S is recoverable.
Which one of the following choices is correct?
(A) Both P and Q are true
(B) P is true and Q is false
(C) P is false and Q is true
(D) Both P and Q are false
Answer: (B)
Explanation:
T1 | T2 | T3 |
R(Y) | ||
R(X) | ||
R(Z) | ||
R(Y) | ||
W(X) | ||
R(Z) | ||
W(Y) | ||
R(X) | ||
W(Z) |
Hence, Statement P is conflict serializable.
Schedule S is recoverable, if Tj creating the dirty read by reading the written data by Ti and Tj commits after Ti commits.
T1 and T2 must be commit before T3 as T3 dirty reads the value at T1 and T2, so if T3 commits before T1 finishes, then S will not recoverable.
Hence Statement Q is false.