CS FundamentalsVery hardGATE CS (PYQ pattern)
Log (LSN: record): 1: T1 update P1; 2: T2 update P2; 3: T1 update P3; 4: begin_checkpoint, whose end_checkpoint records ATT = {T1, T2} and DPT = {P1 (recLSN 1), P3 (recLSN 3)}; 5: T3 update P1; 6: T2 commit; 7: T4 update P4; 8: CLR for T1's update at LSN 3; 9: T3 update P5; 10: T4 update P4. The system crashes after LSN 10. Page LSNs on disk: P1 = 0, P2 = 2, P3 = 0, P4 = 0, P5 = 0. After ARIES analysis, what LSN does the redo pass start from, and how many log records does it actually re-apply (redo applies an update or CLR only if its page is in the DPT, LSN >= the page's recLSN, and the on-disk page LSN is smaller)?
- A. start at LSN 1; 9 records re-applied
- B. start at LSN 5; 7 records re-applied
- C. start at LSN 1; 5 records re-applied
- D. start at LSN 1; 7 records re-applied
Correct answer: D. start at LSN 1; 7 records re-applied
Analysis adds P4 (recLSN 7) and P5 (recLSN 9) to the DPT; the minimum recLSN is 1. P2 is not in the DPT, so LSN 2 is skipped. Re-applied: LSNs [1, 3, 5, 7, 8, 9, 10].
More DBMS and SQL questions
- Log (LSN: record): 1: T1 update P1; 2: T2 update P2; 3: T1 update P3; 4: begincheckpoint, whose endcheckpoint records ATT = {T1, T2} and…
- A system uses UNDO-only logging; log records <T,item,old value> hold the value BEFORE the update. Log: <T1 start>, <T1,A,10>, <T2 start>…
- T1: R1(X), W1(Y), C1 and T2: W2(X), R2(Y), C2. Of all interleavings, let s be the number that are strict schedules (no read or write of an…
- A wait-for graph over T1..T5 has edges T1→T2, T2→T3, T3→T1, T2→T4, T4→T1, T3→T5, T5→T2, T4→T5. How many distinct simple directed cycles…
- Under snapshot isolation item X has committed versions (commit timestamp: value): 0: 10, 5: 20, 9: 30, 14: 40. A transaction reads the…
- T1: R1(X), W1(Y); T2: W2(X), W2(Y); T3: W3(X), W3(Y), R3(Y). Of all 210 interleavings, how many are view-serializable and how many are…