Re: CREATE FUNCTION ... performance boost?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: CREATE FUNCTION ... performance boost?
Дата
Msg-id b42b73150706290925i45b0ca0atcd23ed860b08b9e2@mail.gmail.com
обсуждение исходный текст
Ответ на CREATE FUNCTION ... performance boost?  (Jan Danielsson <jan.m.danielsson@gmail.com>)
Список pgsql-general
On 6/29/07, Jan Danielsson <jan.m.danielsson@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Hello all,
>
>    In order to speed up commonly used queries, I use prepared
> statements. I assume that 'prepare' tells some database query planner to
> take a look at a query, and do all preparations for it, then store those
> preparations somewhere for when it's needed.
>
>    When I use CREATE FUNCTION to create a function, does that also get
> "planned" automatically (plsql, specifically). My gut feeling is that it
> doesn't (mainly since it can be any external language).

'execute' is pretty much the fastest possible way to execute a query
(or, even better, PQexecPrepared via C)...it's less cpu cycles than a
function although barely.       I would suggest maybe rethinking your
query into a view and querying that with or without prepare.

merlin

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

Предыдущее
От: Jan Danielsson
Дата:
Сообщение: CREATE FUNCTION ... performance boost?
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: CREATE FUNCTION ... performance boost?