Re: Interesting case of IMMUTABLE significantly hurting performance

Поиск
Список
Период
Сортировка
От Wolfgang Walther
Тема Re: Interesting case of IMMUTABLE significantly hurting performance
Дата
Msg-id 4ea0957f-d599-47e5-ae9e-758ec6711e03@technowledgy.de
обсуждение исходный текст
Ответ на Re: Interesting case of IMMUTABLE significantly hurting performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane:
> If you err in the other direction, you don't get slapped on the
> wrist that way.  We're willing to inline VOLATILE functions,
> for instance, whether or not the contained expression is volatile.
> Similarly for STRICT, and I think parallel safety as well.
> So my own habit when writing a SQL function that I wish to be
> inlined is to leave off all those markings.

According to [1], this only applies to inlining of scalar functions, but 
not to table functions, which *need* to be either STABLE or IMMUTABLE.

Just mentioning this for anyone taking this advice blindly and leaving 
all marks off, which might not always work as expected in the general case.

Best,

Wolfgang

[1]: https://wiki.postgresql.org/wiki/Inlining_of_SQL_functions




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