Re: Premature view materialization in 8.2?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Premature view materialization in 8.2?
Дата
Msg-id 15902.1175884488@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Premature view materialization in 8.2?  ("Jonathan Ellis" <jonathan@utahpython.org>)
Ответы Re: Premature view materialization in 8.2?
Список pgsql-performance
"Jonathan Ellis" <jonathan@utahpython.org> writes:
> It was in my original post unless it got clipped:

Sorry, I had forgotten.

> The problem seems to be that clan_members_v contains a call to an
> expensive function:

I'll bet that the function is marked VOLATILE.  8.2 is more conservative
about optimizing away volatile functions than previous releases.  If
it has no side effects, mark it STABLE (or can it even be IMMUTABLE?).

In some quick testing, I verified that 8.2 does evaluate the function at
the join level corresponding to the view's join (and I think this is
preventing it from considering other join orders, too).  If you change
the function's marking to be nonvolatile then the function disappears
from the plan entirely, and also it seems to prefer joining "clans" sooner.

            regards, tom lane

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

Предыдущее
От: Michael Stone
Дата:
Сообщение: Re: SCSI vs SATA
Следующее
От: Ron
Дата:
Сообщение: Re: SCSI vs SATA