Re: Nested transactions: low level stuff - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Nested transactions: low level stuff
Date
Msg-id 19725.1048131330@sss.pgh.pa.us
Whole thread Raw
In response to Re: Nested transactions: low level stuff  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Responses Re: Nested transactions: low level stuff  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> Bruce Momjian wrote:
>> You mean abort subtransactions?  Each subtransaction gets its own
>> transaction id, so we just mark that as aborted --- there is no undo of
>> tuples, though I had originally suggested that approach years ago.

> Vadim planned to implement the savepoints functionality
> using UNDO mechanism. AFAIR it was never denied explicitly.

Given all the flak we got about WAL growth during the time we had that
code enabled, I think there's no chance that UNDO will be the preferred
path.  It's not workable with big transactions.

There are other problems besides WAL bloat, too.  I realized while I was
working on the btree code a few weeks ago that it's fundamentally
unfriendly to UNDO, because there are some operations you'd want to
UNDO (viz, insertion of a leaf item pointing at a heap tuple) and some
you would not (viz, splitting of index pages and subsequent insertion of
items into upper tree levels).  But the same WAL entry might include
both kinds of operation.  This could be got round, perhaps, but that
code is overcomplicated already ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: A bad behavior under autocommit off mode
Next
From: Tom Lane
Date:
Subject: Re: cursors outside transactions