Re: DETERMINISTIC as synonym for IMMUTABLE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DETERMINISTIC as synonym for IMMUTABLE
Дата
Msg-id 26281.1098225064@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: DETERMINISTIC as synonym for IMMUTABLE  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> AFAICS, your info shows that the standard's definition of DETERMINISTIC is
> confusing and contradictory. Most people's interpretation would be that
> DETERMINISTIC was the same as IMMUTABLE, so we should make the former a
> synonym for the latter and document the possible difference of
> interpretation. Seriously, if you can't put a blade of grass between them
> then they're OK to be equated.

The problem is that you *can* put a blade of grass between them, and
sooner or later we may wish to make the distinction.  In particular
I can think of optimization possibilities that rely on being able to
identify a function as being a pure function of the database state.
(This would mostly come into play if we ever try to support function
result caching; we don't now, but certainly it's been asked for often
enough.)  If we equate DETERMINISTIC with IMMUTABLE then we won't be
able to use DETERMINISTIC to describe cache-able functions.

Troels's later followup says that SQL2003 has redefined DETERMINISTIC
to in fact mean IMMUTABLE; if so I suppose we'll have to go with the
flow.  I have not looked closely at that version to see if I agree with
his reading.
        regards, tom lane


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

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: plans for bitmap indexes?
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: tsearch2 windows make failure