Re: Does psql use nested transactions? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Does psql use nested transactions?
Date
Msg-id 10131.1092777045@sss.pgh.pa.us
Whole thread Raw
In response to Re: Does psql use nested transactions?  (Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>)
Responses Re: Does psql use nested transactions?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Alvaro Herrera Munoz <alvherre@dcc.uchile.cl> writes:
> Establishing a savepoint is a non-trivial operation (cost-wise).  Several
> internal server structures have to be prepared for it.

Check

> It's way cheaper than normal transaction start and commit,

Is it?  You have the same amount of work to do (sooner or later) in
terms of updating pg_clog, plus extra work to update pg_subtrans.
And in the abort case it can be worse than aborting a full xact, because
we have to do retail rather than wholesale release of locks, buffers, etc.

I have not had an opportunity to benchmark it but I fear a savepoint may
cost near as much as a full xact in practice.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera Munoz
Date:
Subject: Re: Does psql use nested transactions?
Next
From: Tom Lane
Date:
Subject: stop the presses (Re: 7.4.4 packaged ...)