pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: query not scaling
Date: Thu, 26 Oct 2017 11:01:27 -0400
Message-ID: <30441.1509030087@sss.pgh.pa.us> (raw)
In-Reply-To: <1509001363.2666.1.camel@cybertec.at>
References: <6f7d4fd4-aed2-2fae-f551-d0f67196da33@gmail.com>
	<1509001363.2666.1.camel@cybertec.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Laurenz Albe <laurenz.albe@cybertec.at> writes:
> Also, to have PostgreSQL inline the function, which would be good
> for performance, it should be declared IMMUTABLE.

Actually, if you hope to have a SQL function be inlined, it's better
not to decorate it at all --- not with IMMUTABLE, and not with STRICT
either.  Both of those restrict the parser's ability to inline unless
it can prove the contained expression is equally immutable/strict.
With the default attributes of volatile/not strict, there's nothing
to prove.

(In any case, it's usually easy enough to tell from EXPLAIN output
whether inlining has happened.)

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (9+ messages)  latest in thread

Message-ID: <30441.1509030087@sss.pgh.pa.us>
Permalink:  ../30441.1509030087@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30441.1509030087@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, robjsargent@gmail.com
  Subject: Re: query not scaling
  In-Reply-To: <30441.1509030087@sss.pgh.pa.us>
  References: <6f7d4fd4-aed2-2fae-f551-d0f67196da33@gmail.com> <1509001363.2666.1.camel@cybertec.at> <30441.1509030087@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox