GATE / CS ARCHIVE

GATE CSE 2009 / QUESTION 43

Conflict serializability of four schedules

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

GATE 2009, Q43 2 marks · MCQ
Report issue

Transactions & Concurrency Control

Question 43, GATE 2009: T1=R1x, W1x, W1y; T2=R2x, R2y, W2y. S1=R1x, R2x, R2y, W1x, W1y, W2y; S2=R1x, R2x, R2y, W1x, W2y, W1y; S3=R1x, W1x, R2x, W1y, R2y, W2y; S4=R2x, R2y, R1x, W1x, W1y, W2y. Which are conflict-serializable? A S1/S2; B S2/S3; C S3 only; D S4 only.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (4 schedules)

S1 has T2→T1 from r2(x) before w1(x), but T1→T2 from w1(y) before w2(y), so it cycles. S2 has only T2→T1: both its reads and final write of y precede T1’s conflicting writes. S3 has only T1→T2, as w1(x) and w1(y) precede T2’s accesses. S4 cycles for the same opposing x and y directions as S1. Therefore S2 and S3 are conflict-serializable, B.

Build one vertex per transaction and add an edge when an earlier operation conflicts with a later operation of the other transaction on the same item, with at least one write. Reads of different items or two reads do not conflict. S2 has only 2→1, so it is equivalent to serial T2, T1; S3 has only 1→2. S1/S4 each contain both directions and therefore a directed cycle. Acyclicity, not whether operations are interleaved, determines conflict serializability.

Original paper, page 10