geeko
geeko

Reputation: 2852

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 ?

Upvotes: 6

Views: 1968

Answers (2)

Zimbabao
Zimbabao

Reputation: 8240

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 .

Upvotes: 4

geeko
geeko

Reputation: 2852

Thank you pst. I found this article to be one of the best so far: http://answers.oreilly.com/topic/2035-whats-new-in-sqlite-37/

Upvotes: 1

Related Questions