Re: Does psql use nested transactions?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Haroldo Stenger <haroldo(dot)stenger(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Does psql use nested transactions?
Date: 2004-08-17 21:10:45
Message-ID: 10131.1092777045@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-17 22:52:16 stop the presses (Re: 7.4.4 packaged ...)
Previous Message Alvaro Herrera Munoz 2004-08-17 20:58:56 Re: Does psql use nested transactions?