Re: Avoiding evaluating functions twice.

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Avoiding evaluating functions twice.
Дата
Msg-id 20051004215813.GG40138@pervasive.com
обсуждение исходный текст
Ответ на Re: Avoiding evaluating functions twice.  (han.holl@informationslogik.nl)
Список 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;

Why the offset 0?
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

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

Предыдущее
От: Matthew Terenzio
Дата:
Сообщение: Re: License question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: a bug, the bugs list, and how to break the website search.