Re: Repeat execution of stable expressions

Поиск
Список
Период
Сортировка
От Peter van Hardenberg
Тема Re: Repeat execution of stable expressions
Дата
Msg-id CAAcg=kX-fhq2vUmNPQHDcD9fA9ciN=X__SkT6MtueXFXNXAUtw@mail.gmail.com
обсуждение исходный текст
Ответ на Repeat execution of stable expressions  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Repeat execution of stable expressions  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-performance
On Mon, Mar 5, 2012 at 3:15 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
> I've complained many times that
> select (f()).*;
>
> will execute f() once for each returned field of f() since the server
> essentially expands that into:
>
> select f().a, f().b;
>

oh, this is why we expand rows inside a WITH statement.

it should probably be fixed, but you should find something like

WITH fn AS SELECT f(),
SELECT (fn).a, (fn).b

will make your life better

--
Peter van Hardenberg
San Francisco, California
"Everything was beautiful, and nothing hurt." -- Kurt Vonnegut

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Repeat execution of stable expressions
Следующее
От: Yeb Havinga
Дата:
Сообщение: Re: SSD and RAID