CS FundamentalsVery hardProduct company interview · GATE level
Consider the schedule R2(A); R3(B); W1(A); R2(C); W1(C); W2(B); R4(A); W4(C). Which statement is correct?
- A. It is conflict serializable, and the only equivalent serial order is T3, T2, T1, T4
- B. It is conflict serializable, and the only equivalent serial order is T2, T3, T1, T4
- C. It is conflict serializable, and both T3, T2, T1, T4 and T2, T3, T1, T4 are equivalent serial orders
- D. It is not conflict serializable
Correct answer: A. It is conflict serializable, and the only equivalent serial order is T3, T2, T1, T4
Precedence edges: R2(A) before W1(A) gives T2 → T1. R3(B) before W2(B) gives T3 → T2. R2(C) before W1(C) gives T2 → T1 again. W1(A) before R4(A) gives T1 → T4, and R2(C), W1(C) before W4(C) give T2 → T4 and T1 → T4. The graph T3 → T2 → T1 → T4 (plus T2 → T4) has no cycle, so the schedule is conflict serializable, and its only topological order is T3, T2, T1, T4. T2 cannot come before T3 because T3 read B before T2 overwrote it.
More DBMS and SQL questions
- Consider the schedule R1(A); W2(A); W2(B); W1(A); W1(B); W3(A); W3(B). Which statement is correct?
- 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…