Re: Interesting case of IMMUTABLE significantly hurting performance

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Interesting case of IMMUTABLE significantly hurting performance
Дата
Msg-id CAKFQuwY51Us6LeBxtdL7MbHpJkxYpWtMOHJAhUoXXN2p5f1JfQ@mail.gmail.com
обсуждение исходный текст
Ответ на 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 9, 2025 at 1:50 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
If you use EXPLAIN (VERBOSE), you will see that the function gets inlined in the fast case.

That saves the overhead of a function call.

The IMMUTABLE function cannot be inlined because to_char() is not IMMUTABLE.

So, the punishment for lying about the volatility of one's function is to prohibit it from being inlined even in a case where had you been truthful about the volatility it would have been inlined.

David J.

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