Re: Constraint exclusion can't process simple constant expressions?

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Re: Constraint exclusion can't process simple constant expressions?
Дата
Msg-id BANLkTimHBZzEwSR+YBXCLAopvKKuh=1i5A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Constraint exclusion can't process simple constant expressions?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Constraint exclusion can't process simple constant expressions?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-performance
On 21 April 2011 12:13, Josh Berkus <josh@agliodbs.com> wrote:
>> Emphasis on "always".  If the result of the function, given the same
>> argument values, can be different after a SET, then it doesn't qualify
>> for immutability.  At least, that's my understanding.
>
> Hmmmm.  But within the context of the query plan itself, the results of
> that expression are going to be constant.  That is, for a given query
> execution, it's always going to be the same comparison.
>

You may be thinking of the STABLE volatility level.  It requires that
the results of the function are the same for the same inputs, within
the same transaction.

"STABLE indicates that the function cannot modify the database, and
that within a single table scan it will consistently return the same
result for the same argument values, but that its result could change
across SQL statements. This is the appropriate selection for functions
whose results depend on database lookups, parameter variables (such as
the current time zone), etc."

Cheers,
BJ

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

Предыдущее
От: "mark"
Дата:
Сообщение: rant ? check the BBWC
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Constraint exclusion can't process simple constant expressions?