Avoiding evaluating functions twice.

Поиск
Список
Период
Сортировка
От han.holl@informationslogik.nl
Тема Avoiding evaluating functions twice.
Дата
Msg-id 200510041601.40805.han.holl@informationslogik.nl
обсуждение исходный текст
Ответы Re: Avoiding evaluating functions twice.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

I've got the following situation:

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) ?
I've tried stuff like immutable, but that doesn't do anything for me.
Of course I can do a select into, but my guess is it would be even more
expensive than evaluating these functions twice.

Thanks in advance,

Han Holl



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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Maximum # of schemas
Следующее
От: "ctobini"
Дата:
Сообщение: export a select result in a file ?