Re: implementing a database log

From: Christoph Rupp <>
Date: Fri, 25 Apr 2008 02:13:43 -0700 (PDT)
Message-ID: <>

On Apr 24, 4:11 pm, "Brian Selzer" <> wrote:
> If you start out with a set of records and you know what is to be inserted,
> updated, and deleted, you can compute the resulting set of records. If you
> start out with the resulting set of records, and you know what was inserted,
> updated and deleted in order to arrive at that result, then you can compute
> the original set of records. For simplicity, even if it isn't necessarily
> the most efficient, what is updated could be implemented as a set of ordered
> pairs of records, tying each original record to its replacement. So the log
> would consist of a sequence of triples (D, U, I) separated by transaction
> markers where D is a set of records that were deleted, U is a set of pairs
> of records that were updated, and I is a set of records that were inserted.
> Now, provided that the log is written before the database--that is, (1)
> write the triple to the log, (2) write the database, (3) write the
> transaction marker in the log--, it should be possible to determine whether
> or not what was written to the log actually made it into the database, and
> thus it should be possible to roll back any uncommitted transaction.

what about page splits in the index tree? and page merges? You would need special log entries for this, and therefore special rollback mechanisms to undo a page split/merge. Received on Fri Apr 25 2008 - 11:13:43 CEST

Original text of this message