Re: function call vs staright query

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Re: function call vs staright query
Дата
Msg-id 200703191118.55765.Vincenzo.Romano@gmail.com
обсуждение исходный текст
Ответ на Re: function call vs staright query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Monday 19 March 2007 05:07 Tom Lane wrote:
> Vincenzo Romano <vincenzo.romano@gmail.com> writes:
> > How can I delay the query planner decisions until the actual query is to
> > be done inside the function body?
>
> Use plpgsql's EXECUTE.  AFAIR there is no way in a SQL-language function.
>
>             regards, tom lane

The body of a function is *always* treated by the planner as if it were a
dynamically created query. The fact we all use the "$$"s (or also the 's)
around the function body tells it all.

The PREPARE requires every session to do it upon connections, because prepared
statements are managed on a per-session basis.

What I don't understand is why the planner gets passed by during those
queries while it is at full steam during the "normal" queries.
But this could be due to my ignorance! :-)

--
Vincenzo Romano
----
Maybe Computers will never become as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1987]

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: function call vs staright query
Следующее
От: Ruben Rubio
Дата:
Сообщение: Vacuum full is slow