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

From Wolfgang Walther
Subject Re: Interesting case of IMMUTABLE significantly hurting performance
Date
Msg-id 4ea0957f-d599-47e5-ae9e-758ec6711e03@technowledgy.de
Whole thread Raw
In response to Re: Interesting case of IMMUTABLE significantly hurting performance  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Wolfgang Walther
Date:
Subject: Re: Event-Triggers for DB owners instead of just SUPERUSER
Next
From: Dimitrios Apostolou
Date:
Subject: TRUNCATE ONLY with foreign keys and triggers disabled