Re: Stable function optimisation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Stable function optimisation
Дата
Msg-id 21918.1187038900@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Stable function optimisation  (Philipp Specht <phlybye@phlybye.de>)
Ответы Re: Stable function optimisation  (Philipp Specht <phlybye@phlybye.de>)
Список pgsql-performance
Philipp Specht <phlybye@phlybye.de> writes:
> The biggest question here is: Why is the runtime of the query with
> the stable function not near the runtime of the immutable function?

Stable functions don't get folded to constants.

> It's definitely one query and the manual states that a stable
> function does not change in one statement and therefore can be
> optimised.

That's not the type of optimization that gets done with it.  What
"STABLE" is for is marking functions that are safe to use in index
conditions.  If you'd been using an indexable condition you'd have
seen three different behaviors here.

(I see that you do have an index on t.a, but apparently there are
too many matching rows for the planner to think the index is worth
using.)

            regards, tom lane

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

Предыдущее
От: "Relyea, Mike"
Дата:
Сообщение: Re: Help optimize view
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Proposal: Pluggable Optimizer Interface