6

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 ?

user229044
  • 232,980
  • 40
  • 330
  • 338
geeko
  • 2,649
  • 4
  • 32
  • 59
  • 1
    Pick an implementation and see the technical docs? Postgres uses a form of MVCC and has rather good detailed documentation IIRC ... not sure about Firebird or other open engines that can be poked around in. –  Mar 06 '11 at 08:23

2 Answers2

4

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 .

user229044
  • 232,980
  • 40
  • 330
  • 338
Zimbabao
  • 8,150
  • 3
  • 29
  • 36
  • @Zimbabo: thanks! Do you know the difference between MVTO and MVRC ? – geeko Mar 07 '11 at 04:30
  • In your earlier question which I answered I gave you one link (http://simpledbm.googlecode.com/files/mvcc-survey-1.0.pdf). This explains both the algos of MVCC, postgres uses MVTO and InnoDB/Oracle uses MVRC. – Zimbabao Mar 07 '11 at 04:37
  • 1
    @Zimbabao, links are 404ed – Pacerier Jun 26 '13 at 12:58
1

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/

geeko
  • 2,649
  • 4
  • 32
  • 59
  • Available through the Wayback Machine: https://web.archive.org/web/20130901070810/http://answers.oreilly.com/topic/2035-whats-new-in-sqlite-37/ – Mathieu Rey Jun 13 '19 at 01:54