Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below. T1: r1(X); r1(Z); w1(X); w1(Z) T2: r2(Y); r2(Z); w2(Z) T3: r3(Y); r3(X); w3(Y) S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z) Which one of the following statements about the schedules is TRUE?
Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below. T1: r1(X); r1(Z); w1(X); w1(Z) T2: r2(Y); r2(Z); w2(Z) T3: r3(Y); r3(X); w3(Y) S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z) Which one of the following statements about the schedules is TRUE? Correct Answer Only S1 is conflict-serializable
Concept:
- Using precedence graph method, we can find out Schedule is conflict serializable or not.
- If precedence graph has any loop then that schedule is going to be not conflict-serializable.
- If precedence graph doesn’t have any loop then that schedule is going to be conflict-serializable.
Explanation:
Schedule S1:
|
T1 |
T2 |
T3 |
| r(X) | ||
|
|
|
r(Y) |
|
|
|
r(X) |
|
|
r(Y) |
|
|
|
r(Z) |
|
|
|
|
w(Y) |
|
|
w(Z) |
|
|
r(Z) |
|
|
|
w(X) |
|
|
|
w(Z) |
|
|
Precedence graph of S1:
Since there is no loop in S1, it is is conflict serializable
Order: T2 → T1 → T2
Schedule S2:
r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
|
T1 |
T2 |
T3 |
| r(X) | ||
|
|
|
r(Y) |
|
|
r(Y) |
|
|
|
|
r(X) |
|
r(Z) |
|
|
|
|
r(Z) |
|
|
|
|
w(Y) |
|
w(X) |
|
|
|
|
w(Z) |
|
|
w(Z) |
|
|
Precedence graph of S2:
[ alt="F1 Raju Madhu 17.07.20 D2" src="//storage.googleapis.com/tb-img/production/20/07/F1_Raju_Madhu_17.07.20_D2.png" style="width: 131px; height: 103px;">
- So there is loop in S2 so S2 is not conflict serializable.
- Schedule S1 is equivalent to only this serial schedule T2 : T3 : T1.
Hence option 1 is the correct answer.