Re: iscacheable for date/time?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: iscacheable for date/time?
Дата
Msg-id 840.1001516278@sss.pgh.pa.us
обсуждение исходный текст
Ответ на iscacheable for date/time?  (Thomas Lockhart <lockhart@fourpalms.org>)
Список pgsql-hackers
Thomas Lockhart <lockhart@fourpalms.org> writes:
> Can anyone recall why the interval data type would have been
> considered non-cacheable?

I believe I made all functions for all datetime-related types
noncacheable, simply because I wasn't sure which of them had the
"current" behavior.

> For timestamp and timestamptz, I've eliminated the "current" special
> value which afaicr is the only reason timestamp had not been cacheable
> in the past. Are there any functions which should *not* be considered
> cacheable for those types? Apparently the _in() and _out() functions
> should not be?

in() should not be, since its result for the strings "now", "today",
"tomorrow", etc is variable.  But AFAICS there's no reason to mark out()
as noncacheable anymore.

The general rule is: if there are any fixed input values for which the
output might vary over time, then it should be noncachable.

Dunno why to_char is marked noncachable; does it perhaps have
format-string entries that pick up current time somehow?  I might just
have been worried about its response to "current", though.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: PERFORMANCE IMPROVEMENT by mapping WAL FILES
Следующее
От: Tom Lane
Дата:
Сообщение: Re: iscacheable for date/time?