Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1Xpn-0004If-4L for pgsql-performance@arkaria.postgresql.org; Mon, 30 Jun 2014 09:25:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X1Xpm-0006Oo-Ib for pgsql-performance@arkaria.postgresql.org; Mon, 30 Jun 2014 09:25:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1Xpl-0006MC-3G for pgsql-performance@postgresql.org; Mon, 30 Jun 2014 09:25:09 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1Xph-00051o-SW for pgsql-performance@postgresql.org; Mon, 30 Jun 2014 09:25:07 +0000 Received: from ayaki.localdomain (58-7-64-142.dyn.iinet.net.au [58.7.64.142]) by mrelayeu.kundenserver.de (node=mreue104) with ESMTP (Nemesis) id 0LfjPW-1WI0jR162k-00pLKa; Mon, 30 Jun 2014 11:25:01 +0200 Message-ID: <53B12CE7.5090506@2ndquadrant.com> Date: Mon, 30 Jun 2014 17:24:55 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" CC: Tom Lane , Pavel Stehule Subject: Volatility - docs vs behaviour? X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:8PvmW5tGRd4f8sh7o/9ma77PwBHlyBSSg0rv/5So9rC M0U1M2RcZvis1LebYE1+VT9veSVpBLKKTo48hR9qKEV/dG1Y+m Aw3QT8p9r7HLf4JB/DSaQyC0I0q3dWe1Y70p2Apl+0JDdHEn5Z 0rklYi4RJGQP10LvgM7v41/1rmbZQOsAEB5K/2yHHd8ZHXwRTw oEVNTCymfIc5gOpIfgT158EfWoslkI02pTEGPkpA8wLwZ1Fi9r SN0r7MGVoFYfZlibHP/qlsyQ6b3JOIx0O3GtkqLfAlgMtvx3oK yOvdYVEOfPJ4+zhNH0mi1yzEQRKaTBhKti/4i42u0vFYxFTr2Q a7WoBw2NXaxkrTVcyVUvXEKf3X4O9zRBedpllqr+S X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance