Practice free →
HomeGATE CSEcomputerscienceDatabase Management Systems › The write-ahead rule states that

The write-ahead rule states that

Athe data page must be written to disk before the log record
Bthe log record can be written any time relative to the data page
Cevery transaction must write to the log before reading anything
Dlog record must be on disk before the data page
Answer & Solution
Correct answer: D. log record must be on disk before the data page
WAL = the log entry hits disk first, then the data page. This ordering ensures that on crash, the log always knows about any data page change that made it to disk, so undo/redo can work. Reversing the order would let a data change exist on disk with no log record explaining how to undo it.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions