Re: Interesting case of IMMUTABLE significantly hurting performance

Поиск
Список
Период
Сортировка
От Nico Williams
Тема Re: Interesting case of IMMUTABLE significantly hurting performance
Дата
Msg-id Z/bk5E6pqIBWTF3j@ubby
обсуждение исходный текст
Ответ на Re: Interesting case of IMMUTABLE significantly hurting performance  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Interesting case of IMMUTABLE significantly hurting performance
Список pgsql-general
On Wed, Apr 09, 2025 at 10:50:00PM +0200, Laurenz Albe wrote:
> The IMMUTABLE function cannot be inlined because to_char() is not IMMUTABLE.

Q: Why would to_char() not be IMMUTABLE?

A: Because it makes use of locales, and I guess the guc-timezone GUC,
   which could change if the expression is ultimately used in a PlPgSQL
   fragment, or if it's in a prepared statement.  (I think.)

That to_char is not immutable is not documented though.  Though it's
clear when looking at the docs for the `jsonb_.*_tz()` functions.

Nico
-- 



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