Re: pl/python improvements

Поиск
Список
Период
Сортировка
От Jan Urbański
Тема Re: pl/python improvements
Дата
Msg-id 4CFEA056.9080805@wulczer.org
обсуждение исходный текст
Ответ на Re: pl/python improvements  (Andres Freund <andres@anarazel.de>)
Список 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@postgresql.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: unlogged tables
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Review: Extensions Patch