Re: pl/python improvements

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pl/python improvements
Date: 2010-12-07 21:00:06
Message-ID: 4CFEA056.9080805@wulczer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/12/10 21:33, Andres Freund wrote:
> On Tuesday 07 December 2010 20:17:57 Jan Urbański wrote:
>> * execute SPI calls in a subtransaction, report errors back to Python
>> as exceptions that can be caught etc.
> Youre doing that unconditionally? I think the performance impact of this will
> be too severe... Subtransactions can get quite expensive - especially in the
> face of HS.

See
http://www.mail-archive.com/pgsql-hackers(at)postgresql(dot)org/msg163004.html :(

>> * explicit subxact starting, so you can issue consecutive plpy.execute
>> calls atomically
> That likely obsoletes my comment from above.

Not really, I'm afraid :( You can pay the subxact overhead once with
explicit subxact starting, but you always have to pay it...

with plpy.subxact():
plpy.execute("select 1")
plpy.execute("select 2")
plpy.execute("select 3")

will start only 1 subxact, as opposed to 3.

Cheers,
Jan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-12-07 21:17:10 Re: pg_execute_from_file review
Previous Message Tom Lane 2010-12-07 20:44:59 Re: unlogged tables