Re: how to evaluate a function only once for a query?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to evaluate a function only once for a query?
Дата
Msg-id 11294.1024578768@sss.pgh.pa.us
обсуждение исходный текст
Ответ на how to evaluate a function only once for a query?  (Nicolae Mihalache <mache@abcpages.com>)
Ответы Re: how to evaluate a function only once for a query?  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-general
Nicolae Mihalache <mache@abcpages.com> writes:
> I've created a function timevalue(text) that returns a timestamp as
> result. The function works just fine.
> However, when I do a query like:
> "select * from mytable where time<timevalue('something')" I see that my
> function is evaluated once for each row in mytable.

See the "isCachable" attribute in CREATE FUNCTION.

            regards, tom lane

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: db grows and grows
Следующее
От: Fran Fabrizio
Дата:
Сообщение: Re: db grows and grows