CS FundamentalsVery hardGATE CS (PYQ pattern)

Optimistic concurrency control with backward validation. Transactions (start, validation, finish times; read set; write set): T1 (0, 4, 5; {A,B}; {B}), T2 (2, 6, 9; {B,C}; {C}), T3 (3, 8, 11; {D}; {A}), T4 (7, 10, 12; {C}; {E}). Transactions are validated in validation-time order against every earlier transaction that PASSED validation; Tj passes against Ti if (1) Ti finishes before Tj starts, or (2) Ti finishes before Tj's validation and WS(Ti) ∩ RS(Tj) = ∅, or (3) WS(Ti) ∩ RS(Tj) = ∅, WS(Ti) ∩ WS(Tj) = ∅ and Ti finishes before Tj finishes. Which transactions pass?

  1. A. T1, T4
  2. B. T1, T2
  3. C. T1, T3, T4
  4. D. T1, T3

Correct answer: C. T1, T3, T4

T1 passes (nothing earlier). T2 vs T1: T1 finishes at 5 before T2's validation at 6 and WS(T1) = {B} intersects RS(T2) = {B,C}, so (2) fails; (1) fails (5 > 2) and (3) fails (WS and RS overlap), so T2 fails. T3 vs T1: finishes 5 < 8 and WS(T1) = {B} does not meet RS(T3) = {D}: passes. T4 vs T1: T1 finished before T4 started: ok; vs T3: T3 finishes at 11, after T4 starts, WS(T3) = {A} does not meet RS(T4) = {C} but (2) needs T3 to finish before T4's validation (10): no; (3) needs T3 to finish before T4 finishes (12): yes, and WS(T3) is disjoint from WS(T4): passes.

More DBMS and SQL questions

Exams that ask this topic