Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would you log in a write-ahead log?

What do DBMSs that implement multi-version timestamp ordering for concurrency control usually include in their write-ahead logs ? before and after images, or one of them ? timestamps ? what else ?

like image 584
geeko Avatar asked Mar 06 '11 08:03

geeko


1 Answers

Documentation of Postgres WAL. Postgres uses MVTO type of MVCC. InnoDB uses MVRC.

Here is Postgres log structure and pg_control structure, which is important for the recovery. Timestamps are not used as its not reliable, rather they use monotonically increasing integer counter (transaction id).

So all the rollback related data is stored in main data itself, not in WAL.

Main purpose of WAL is to recover data incase of problems due to power failure, OS problems or some hardware failure (obviously except serious disk failures). So WAL should be pretty much independent of that.

Innodb log structure is in innodb/include/log0log.h .

like image 72
Zimbabao Avatar answered Sep 17 '22 23:09

Zimbabao