CS FundamentalsVery hardGATE CS
ARIES log: LSN1 T1 update P1; LSN2 T2 update P2; LSN3 T1 update P3; LSN4 begin_checkpoint; LSN5 end_checkpoint with active transactions {T1, T2} and dirty page table {P2: recLSN 2, P3: recLSN 3} (P1 had been flushed before the checkpoint); LSN6 T3 update P4; LSN7 T2 commit; LSN8 T1 update P1; LSN9 T3 update P2; LSN10 T2 end. The system crashes. Assume no page was flushed after the checkpoint and every dirty page on disk is older than its recLSN. At the start of redo, at which LSN does the scan begin, and how many update records are actually redone?
- A. LSN 1 and 6 updates
- B. LSN 2 and 5 updates
- C. LSN 2 and 6 updates
- D. LSN 1 and 5 updates
Correct answer: B. LSN 2 and 5 updates
The analysis pass rebuilds the dirty page table: P2 (2), P3 (3), P4 (6, added by LSN6) and P1 (8, re-dirtied by LSN8 after its flush). Redo starts at the smallest recLSN = 2. Updates at LSN 2, 3, 6, 8 and 9 are redone; the update at LSN 1 is skipped because P1 was flushed and its recLSN is now 8.
More DBMS and SQL questions
- Sa(m, amt) holds monthly sales (2024-01, 100), (2024-02, 130), (2024-03, 130), (2024-04, 90), (2024-05, 150), (2024-06, 150), (2024-07…
- Table T(x) holds the values 1, NULL, 3, NULL, 3. What does SELECT COUNT(), COUNT(x), COUNT(DISTINCT x) FROM T return?
- Emp(n, dept, sal) has rows (A, d1, 40), (B, d1, 70), (C, d2, 45), (D, d2, 50), (E, d3, 80), (F, d3, 30), (G, d4, 60). How many rows does…
- Dept(d) has rows 1, 2, 3 and Emp(e, d) has rows (a, 1), (b, 1), (c, 2). How many rows does SELECT D.d FROM Dept D LEFT JOIN Emp E ON D.d =…
- R(A, B, C, D) has the functional dependencies AB -> C, C -> D and D -> A. How many candidate keys does R have?
- S(v) has rows 1, 2, 3 and U(v) has rows 2, NULL. What does SELECT COUNT() FROM S WHERE v NOT IN (SELECT v FROM U) return?