CS FundamentalsModerateIBM · Deloitte pattern
Write-ahead logging (WAL) requires that:
- A. Log records are optional as long as a checkpoint exists
- B. WAL only applies to the undo phase, not redo
- C. Log records for a change must be written to stable storage before the corresponding data page change is written to disk
- D. Data pages must always be written to disk before their log records
Correct answer: C. Log records for a change must be written to stable storage before the corresponding data page change is written to disk
WAL's defining rule is: before a dirty page is flushed to disk, every log record describing changes on that page (up to the LSN 'covering' the change) must already be durable. This guarantees recovery can always redo (or undo) a change using the log, even if the actual data page write never made it to disk before a crash.
More DBMS and SQL questions
- A fuzzy checkpoint in ARIES records the set of active (dirty) transactions and dirty pages at checkpoint time WITHOUT forcing all dirty…
- Strict two-phase locking (Strict 2PL) differs from basic 2PL in which way?
- Rigorous two-phase locking (Rigorous 2PL) goes one step further than Strict 2PL. What extra guarantee does it add?
- Multiple Granularity Locking uses intention locks (IS, IX, SIX) on coarser objects like a table, in addition to ordinary shared/exclusive…
- A foreign key column is declared ON DELETE CASCADE. If the referenced (parent) row is deleted, what happens to the child rows referencing…
- A schema uses salary DECIMAL(8,2) for a salary column. Which value would be REJECTED when inserted?