CS FundamentalsVery hardGATE CS (PYQ pattern)
A system uses immediate database modification with a log. Log (oldest first): <T1 start>, <T1,A,10,20>, <T2 start>, <T2,B,5,6>, <T1 commit>, <checkpoint {T2}>, <T3 start>, <T3,C,1,2>, <T2,B,6,9>, <T2 commit>, <T4 start>, <T4,D,7,8>, <T3 commit>. A crash occurs after the last record. Which transactions are redone and which undone by the standard recovery procedure (redo committed transactions that are on the checkpoint list or started after it; undo the uncommitted ones)?
- A. Redo T1, T2, T3; undo T4
- B. Redo T2, T3; undo T4
- C. Redo T3 only; undo T2 and T4
- D. Redo T2, T3, T4; undo nobody
Correct answer: B. Redo T2, T3; undo T4
T1 committed before the checkpoint (its effects are already on disk), so it is ignored. T2 was active at the checkpoint and committed: redo. T3 started after it and committed: redo. T4 never committed: undo.
More DBMS and SQL questions
- A 10,000-page file is sorted by external merge sort with 21 buffer pages: later passes merge 20 runs at a time, and every pass reads and…
- Block nested-loop join of R (800 pages) and S (300 pages) with 52 buffer pages (1 for the inner input, 1 for output, 50 for the outer…
- R(A, B) has 10,000 tuples with V(R, B) = 200; S(B, C) has 5,000 tuples with V(S, B) = 500 and V(S, C) = 100; T(C, D) has 2,000 tuples with…
- An extendible hash index uses the LOW-order bits of the hash value, with bucket capacity 2 and an initial directory of global depth 1 (two…
- A file of 100,000 records of 120 bytes is stored in 4096-byte blocks, each with an 8-byte header (records do not span blocks), sorted on…
- R(A, B, C, D, E) has the functional dependencies DB → A, A → C, D → C, C → B. R is decomposed and one fragment is R1(A, C, D). Counting…