why do DBMS use redo log?

187 views Asked by At

redo log is used for redo committed transaction after DB crash. However, updates of committed transaction are written to disk when commit. why does DBMS use redo log? What actually a DBMS does when a transaction commits? Thanks!

1

There are 1 answers

0
755 On

Not exactly; Redo is performed on a redoable action only if none of these 3 conditions applies: (quoted straight from Ramakrishnan and Gehrke)

The affected page is not in the dirty page table.

The affected page is in the dirty page table, but the recLSN for the entry is greater than the LSN of the log record being checked.

The pageLSN (stored on the page, which must be retrieved to check this condition) is greater than or equal to the LSN of the log record being checked.

If none of those are true, that basically means the action was successfully commited.