Re: Interesting case of IMMUTABLE significantly hurting performance - Mailing list pgsql-general

From David G. Johnston
Subject Re: Interesting case of IMMUTABLE significantly hurting performance
Date
Msg-id CAKFQuwY51Us6LeBxtdL7MbHpJkxYpWtMOHJAhUoXXN2p5f1JfQ@mail.gmail.com
Whole thread Raw
In response to Re: Interesting case of IMMUTABLE significantly hurting performance  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Interesting case of IMMUTABLE significantly hurting performance
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [EXTERNAL] Re: Cannot connect local with ttrust (pg_upgrade assumes it)
Next
From: Nico Williams
Date:
Subject: Re: Interesting case of IMMUTABLE significantly hurting performance