Re: Important speed difference between a query and a function with the same query

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Important speed difference between a query and a function with the same query
Дата
Msg-id 20030425100905.D66185@flake.decibel.org
обсуждение исходный текст
Ответ на Important speed difference between a query and a function with the same query  (Frederic Jolliton <fred-pg@jolliton.com>)
Список pgsql-performance
On Wed, Apr 23, 2003 at 07:53:55PM +0200, Frederic Jolliton wrote:
> CREATE FUNCTION get_info (integer) RETURNS SETOF type_get_info
>     AS '...' <- here the query show below, where 'LIMIT $1' is used instead of 'LIMIT 10'
>     LANGUAGE sql;

You should probably define the function to be STABLE.

     LANGUAGE sql STABLE;

See
http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=sql-createfunction.html
for more info.
--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: More tablescanning fun
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: More tablescanning fun