pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Nicholson, Brad (Toronto, ON, CA) <bnicholson@hp.com>
Cc: Rob Richardson <RDRichardson@rad-con.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: transaction error handling
Date: Thu, 01 Dec 2011 07:36:54 +0800
Message-ID: <4ED6BE16.5090706@ringerc.id.au> (raw)
In-Reply-To: <EC55DC235432104F8255702A8D7344D9256FF7EF@G9W0741.americas.hpqcorp.net>
References: <CAANiQEm92w70rapQhitV1qL0tpkNRo5qjpwo2fdg+iZ-AURMCg@mail.gmail.com>
	<28131.1322067903@sss.pgh.pa.us>
	<232B5217AD58584C87019E8933556D11036BDE58EB@redmx2.esri.com>
	<67D108EDFAD3C148A593E6ED7DCB4BBDEDDBAE@RADCONWIN2K8PDC.radcon.local>
	<EC55DC235432104F8255702A8D7344D9256FF7EF@G9W0741.americas.hpqcorp.net>

On 11/30/2011 09:19 PM, Nicholson, Brad (Toronto, ON, CA) wrote:
> This functionality is something that Postgres can do today. We expose 
> the ability to do this with explicit savepoints. The difference is 
> that Oracle allows you to set it on a per transaction basis (I 
> believe) and it will behave this way for all statements in the 
> transaction, where as we need to do it explicitly. Looking through the 
> archives there does seem to be a performance problem on commit in 
> Postgres if you issue a lot of savepoints (there were discussions of a 
> fix but I am not sure the status of this).
Savepoint performance has had several improvements over time. Back in 
8.1 when I got started developing against Pg seriously I was having 
*MASSIVE* performance issues with PL/PgSQL exception blocks (which use 
savepoints) in loops; these days it's perfect.

To make automatic savepoints viable, Pg would need to be able to 
completely forget a savepoint once it's been released, so there's no 
ongoing cost. That way a transaction would only need two savepoints at 
any particular point in time. My understanding is that it's not there 
yet; AFAIK released savepoints still have a non-trivial cost that would 
add up if someone was using automatic savepoints in (say) a 10,000 
INSERT transaction.

--
Craig Ringer



view thread (14+ messages)  latest in thread

Message-ID: <4ED6BE16.5090706@ringerc.id.au>
Permalink:  ../4ED6BE16.5090706@ringerc.id.au/
Also on:    postgresql.org/message-id/4ED6BE16.5090706@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, bnicholson@hp.com, RDRichardson@rad-con.com
  Subject: Re: transaction error handling
  In-Reply-To: <4ED6BE16.5090706@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox