CS FundamentalsHardGATE CS · Product placement
The system crashes after the last record of this log (immediate database modification; <Ti, X> denotes an update with old and new values; the checkpoint lists the transactions active at that moment and all dirty pages were flushed when it was taken): <T3 start>, <T3, A>, <T5 start>, <T5, B>, <T3 commit>, <T4 start>, <T4, C>, <checkpoint {T4, T5}>, <T2 start>, <T2, D>, <T4, E>, <T2 commit>, <T5, F>, <T1 start>, <T1, G>, <T1 commit> Which transactions must be undone and which redone?
- A. Undo {T3, T4, T5}; redo {T1, T2}
- B. Undo {T1, T2}; redo {T4, T5}
- C. Undo {T4, T5}; redo {T1, T2}
- D. Undo {T4, T5}; redo {T1, T2, T3}
Correct answer: C. Undo {T4, T5}; redo {T1, T2}
Transactions that committed before the checkpoint (T3) are already on disk and need nothing. Those that committed after it (T1, T2) are redone, whether they started before or after it. Those with no commit record (T4, T5) are undone, including any that were active at the checkpoint.
More DBMS and SQL questions
- Table Sale(id, rep, region, amt) rows: (1, 'Ira', 'N', 100), (2, 'Jai', 'S', 250), (3, 'Ira', 'S', NULL), (4, 'Kim', 'N', 300), (5, 'Jai'…
- R(A, B, C, D, E, F) has functional dependencies B → ACDEF. What is the highest normal form R satisfies?
- Which isolation anomaly is still possible at the SQL REPEATABLE READ level (as defined by the SQL standard)?
- A B-tree (not B+ tree) stores a record pointer with every key in every node. With 2048-byte blocks, 16-byte keys, 8-byte tree pointers and…
- Table P(x) rows: (1), (2), (2), (3), (NULL). Table Q(x) rows: (2), (3), (3), (NULL), (4). What does this query return? sql SELECT (SELECT…
- R(A, B) = {(1, 4), (2, 4), (3, 3), (4, 1), (4, 3)} and S(B, C) = {(1, 6), (2, 5), (2, 6), (3, 5), (4, 5)}. How many tuples are in πA(R ⋈…