Re: pgsql: Fix plpgsql to release SPI plans when a function or DO block is

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Дата
Msg-id 4D9037D2.2020105@enterprisedb.com
обсуждение исходный текст
Ответ на pgsql: Fix plpgsql to release SPI plans when a function or DO block is  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Fix plpgsql to release SPI plans when a function or DO block is  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
On 27.03.2011 19:51, Tom Lane wrote:
> Fix plpgsql to release SPI plans when a function or DO block is freed.
>
> This fixes the gripe I made a few months ago about DO blocks getting
> slower with repeated use.  At least, it fixes it for the case where
> the DO block isn't aborted by an error.  We could try running
> plpgsql_free_function_memory() even during error exit, but that seems
> a bit scary since it makes a lot of presumptions about the data
> structures being in good shape.  It's probably reasonable to assume
> that repeated failures of DO blocks isn't a performance-critical case.

I was quite surprised by the way you did this. Instead of adding all
that code to traverse the PLpgSQL_stmt tree (that we'll have to remember
to keep up-to-date), can't we just have a list of cached plans in
PLpgSQL_function? As attached.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Typo fix in SSI docs.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Fix plpgsql to release SPI plans when a function or DO block is