Volatility - docs vs behaviour? - Mailing list pgsql-performance

From Craig Ringer
Subject Volatility - docs vs behaviour?
Date
Msg-id 53B12CE7.5090506@2ndquadrant.com
Whole thread Raw
Responses Re: Volatility - docs vs behaviour?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Hi all

The docs say:

"For best optimization results, you should label your functions with the
strictest volatility category that is valid for them."

http://www.postgresql.org/docs/current/interactive/xfunc-volatility.html

... but I recall discussion here suggesting that in fact IMMUTABLE
functions may not be inlined where you'd expect, e.g.

http://www.postgresql.org/message-id/CAFj8pRBF3Qr7WtQwO1H_WN=hhFGk0semwhdE+ODz3iyv-TroMQ@mail.gmail.com

That's always seemed counter to my expectations. Am I just
misunderstanding? Tom's comment seemed to confirm what Pavel was saying.

I know STRICT can prevent inlining (unfortunately, though necessarily),
but it seems inexplicable that IMMUTABLE should. If it can, then the
documentation is wrong.

Which is it?

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-performance by date:

Previous
From: Pujol Mathieu
Date:
Subject: Re: GIST optimization to limit calls to operator on sub nodes
Next
From: Tom Lane
Date:
Subject: Re: GIST optimization to limit calls to operator on sub nodes