CS FundamentalsVery hardProduct company interview · GATE level
Consider the schedule R1(A); W2(A); W2(B); W1(A); W1(B); W3(A); W3(B). Which statement is correct?
- A. It is conflict serializable, equivalent to the serial order T1, T2, T3
- B. It is not conflict serializable, but it is view serializable, equivalent only to the serial order T1, T2, T3
- C. It is not conflict serializable, but it is view serializable, equivalent to both T1, T2, T3 and T2, T1, T3
- D. It is neither conflict serializable nor view serializable
Correct answer: B. It is not conflict serializable, but it is view serializable, equivalent only to the serial order T1, T2, T3
R1(A) before W2(A) gives T1 → T2, while W2(A) before W1(A) gives T2 → T1: a cycle, so the schedule is not conflict serializable. For view equivalence only three things matter: T1's read of A must see the initial value, and the final writes of A and B must both come from T3. The serial order T1, T2, T3 satisfies all three. In T2, T1, T3 the read R1(A) would see T2's value instead of the initial one, so that order is not view equivalent, and any order with T3 not last changes the final writes. The writes of T2 and T1 are overwritten by T3's blind writes, which is what makes view serializability possible here.
More DBMS and SQL questions
- T1 executes R1(A); W1(A); R1(B) and T2 executes R2(B); W2(B); R2(A). Of the 20 possible interleavings of these two transactions (including…
- No transaction has committed yet in the schedule W1(A); R2(A); W2(B); R3(B); W4(B); R5(B). T1 now aborts. Besides T1, which transactions…
- A lock manager grants a request whenever it is compatible with the locks currently held; otherwise the requester waits. The requests…
- Transactions T1, T2 and T3 have timestamps 1, 2 and 3. All read and write timestamps of items A and C are initially 0, and the operations…
- A B+ tree uses 4096-byte blocks, 12-byte search keys, 8-byte block pointers and 10-byte record pointers. An internal node with p child…
- A B+ tree holds 10,000 keys in its leaves. A leaf holds at most 20 and at least 10 keys; an internal node has at most 30 and at least 15…