Re: Avoiding evaluating functions twice.

Поиск
Список
Период
Сортировка
От han.holl@informationslogik.nl
Тема Re: Avoiding evaluating functions twice.
Дата
Msg-id 200510042111.50815.han.holl@informationslogik.nl
обсуждение исходный текст
Ответ на Re: Avoiding evaluating functions twice.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Avoiding evaluating functions twice.  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-general
On Tuesday 04 October 2005 17:25, Tom Lane wrote:
> han.holl@informationslogik.nl writes:
> > select expensive_function(table) from table
> >                      where expensive_function(table) is not null;
> >
> > Is there a way to avoid that expensive_function is evaluated twice (if
> > it's not null) ?
>
> You can do something like this:
>
> select f from
> (select expensive_function(table) as f from table offset 0) ss
> where f is not null;
>
Thanks.

I think I can safely say I wouldn't have invented this magic in a year.

Cheers

Han Holl

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

Предыдущее
От: Arthur Hoogervorst
Дата:
Сообщение: Re: License question
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: License question