Re: Invalid optimization of VOLATILE function in WHERE clause?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Invalid optimization of VOLATILE function in WHERE clause?
Дата
Msg-id CA+TgmobUsLZZ2-j9e1tDrw6csynUDTF1ZGz-cg9nVkAC1VWx4g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Invalid optimization of VOLATILE function in WHERE clause?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Sep 19, 2012 at 1:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> It still seems like awfully weird behavior.
>
> Why?  The WHERE condition relates only to the output of the _stats
> subquery, so why shouldn't it be evaluated there, rather than after
> the join?

Because my mental model (and apparently that of the OP) is that the
WHERE clause gets evaluated separately for each row.  Obviously in
many cases that can be optimized without changing the results, but not
in this case.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Removal of AcceptInvalidationMessages broke things
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Invalid optimization of VOLATILE function in WHERE clause?