GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 37

GATE CSE 2020 Q37

Database Management Systems · Transactions & Concurrency Control · Full GATE CSE 2020 paper

GATE 2020, Q37 2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 37, GATE 2020: Read the following schedule equivalents left to right; Ri(X),Wi(X) belong to transaction i. Both commits follow the listed operations in order C1,C2. Original: R1(A),R2(B),W2(B),R1(C),R2(D),W1(D),W2(C),W1(B),C1,C2. Which is conflict equivalent?
A R2(B),W2(B),R2(D),R1(A),R1(C),W1(D),W1(B),W2(C),C1,C2.
B R1(A),R1(C),W1(D),W1(B),R2(B),W2(B),R2(D),W2(C),C1,C2.
C R1(A),R1(C),W1(D),R2(B),W2(B),R2(D),W1(B),W2(C),C1,C2.
D R2(B),W2(B),R2(D),W2(C),R1(A),R1(C),W1(D),W1(B),C1,C2.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (5 schedules)

Worked explanation

Two operations conflict exactly when they belong to different transactions, access the same item, and at least one writes. There is no cross-transaction access to A. On B, both R2(B) and W2(B) precede W1(B). On D, R2(D) precedes W1(D). On C, R1(C) precedes W2(C). Those four pairwise orders are the complete test, independent of where unrelated reads move. A preserves all four and each transaction’s internal order. B reverses the B and D orders; C reverses only the D order among these; D reverses C. The precedence graph contains both T2→T1 and T1→T2, so the original is not conflict-serializable, but it can still have a conflict-equivalent nonserial schedule. Do not confuse these two questions.

Derivation and answer

The original intertransaction conflict orders are R2(B)<W1(B), W2(B)<W1(B), R2(D)<W1(D), and R1(C)<W2(C). OptionA preserves all four. B reverses the B andD conflicts; C reverses theD conflict; D reverses theC conflict. Thus A.

Original paper, page 12 · Answer key