Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan
Дата
Msg-id CAFj8pRAFjMFu4XQbpruWze_c+oMyVoh0=0ays2Yx=dd4Y0RY9w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers


2017-09-05 19:38 GMT+02:00 Tom Lane <tgl@sss.pgh.pa.us>:
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2. what syntax we should to use (if we accept this feature)? There was not
> another proposal if I remember well - The PRAGMA syntax is strong because
> we can very well specify to range where the plans caching will be
> explicitly controlled. It is well readable and static.

The complaint I have about PRAGMA is that it's yet another syntax for
accomplishing pretty much the same thing.  If you don't like the GUC
solution, we've already got the "comp_option" syntax for static options
in plpgsql.  Sure, that's not too pretty, but that's not a good reason
to invent yet another way to do it.

comp_option has only function scope, what is too limited for this purpose. 

I don't prefer GUC for this purpose because you need to do SET/RESET on two places. With GUC the code can looks like:

PERFORM set_config('cachexx', 'off')
FOR r IN SELECT ...
LOOP
  PERFORM set_config(' cachexx', 'on')
  ....
  PERFORM set_config('cachexx', 'off')
END LOOP;
PERFORM set_config('cachexx', 'on');


The another reason for inventing PRAGMA syntax to PLpgSQL was support for autonomous transaction and I am thinking so is good idea using same syntax like PL/SQL does.
 

                        regards, tom lane

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

Предыдущее
От: Jesper Pedersen
Дата:
Сообщение: Re: [HACKERS] Fix performance of generic atomics
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] [COMMITTERS] pgsql: Add psql variables showing server version and psql version.