CS FundamentalsHardGATE CS (PYQ pattern)
A log (immediate modification, redo-undo recovery, checkpoint lists active transactions) reads: <T1 start>, <T1,A,1,2>, <T2 start>, <T2,B,3,4>, <T1 commit>, <T3 start>, <checkpoint {T2,T3}>, <T3,C,5,6>, <T2,D,7,8>, <T4 start>, <T4,E,9,10>, <T2 commit>, <T5 start>, <T5,F,11,12>, <T5 commit>. A crash occurs now. How many update records are REDONE and how many UNDONE during recovery (redo transactions that committed after the checkpoint or are on its list; undo uncommitted ones; ignore T1)?
- A. 4 redone, 2 undone
- B. 3 redone, 1 undone
- C. 3 redone, 2 undone
- D. 2 redone, 2 undone
Correct answer: C. 3 redone, 2 undone
T1 committed before the checkpoint, so ignore it. Redo: T2 (updates B and D, 2 records; it is on the checkpoint list and committed) and T5 (1 record) = 3 update records. Undo: T3 (C) and T4 (E), which never committed = 2 records.
More DBMS and SQL questions
- A B+ tree has 4096-byte nodes, 10-byte keys and 6-byte tree pointers. An internal node with n pointers carries n - 1 keys. A leaf holds…
- A query scans a table of 11 pages sequentially, 5 times in a row, with a buffer pool of 10 pages (initially empty). How many buffer hits…
- An ER model has entity sets E1, E2, E3 and a weak entity W (identified through E3 by an identifying 1:N relationship). Relationships…
- Entity sets A (6 entities) and B (9 entities) are linked by relationship R. Every A entity must take part in R (total participation) and…
- E1(id, d, s): (1,x,50), (2,x,70), (3,x,70), (4,y,40), (5,y,40), (6,z,90), (7,z,NULL), (8,w,NULL). How many rows does SELECT FROM E1 a…
- LG(g, t, v): (a,1,10), (a,2,15), (a,3,12), (b,1,7), (b,2,7), (b,3,20). What does SELECT SUM(d) FROM (SELECT v - COALESCE(LAG(v) OVER…