Let S be the following schedule of operations of three transactions \(T_1, \…
2021
Let S be the following schedule of operations of three transactions \(T_1, \ T_2\) and \(T_3\) in a relational database system:
\(R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z)\)
Consider the statements \(P\) and \(Q\) below:
\(P\): \(S\) is conflict-serializable.
\(Q\): If \(T_3\) commits before \(T_1\) 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
Attempted by 124 students.
Show answer & explanation
Correct answer: B
Answer: The first statement is true and the second statement is false.
Reasoning:
Build the precedence (conflict) graph from conflicting operations.
T1 -> T2 because T1 reads Y before T2 writes Y (R1(Y) occurs before W2(Y)).
T2 -> T3 because T2 reads Z before T3 writes Z (R2(Z) occurs before W3(Z)).
T1 -> T3 because T1 writes X before T3 reads X (W1(X) occurs before R3(X)).
These edges give an acyclic graph (T1 -> T2 -> T3, with T1 -> T3 also). An acyclic precedence graph means the schedule is conflict-serializable, so the first statement is true.
Check recoverability: T3 reads X after T1 wrote X, so T3 read a value produced by T1.
A schedule is recoverable only if whenever a transaction reads a value written by another transaction, the writer commits before the reader commits. If T3 commits before T1 finishes (i.e., before T1 commits), then T3 has committed after reading an uncommitted write from T1, violating recoverability.
Therefore: the schedule is conflict-serializable (first statement true), but it is not guaranteed to be recoverable under the given commit ordering (second statement false).
A video solution is available for this question — log in and enroll to watch it.