From: Andres Freund <andres@anarazel.de>
To: pgsql-performance@postgresql.org
Cc: Julius Tuskenis <julius@nsoft.lt>
Subject: Re: unexpected stable function behavior
Date: Mon, 14 Mar 2011 15:08:14 +0100
Message-ID: <201103141508.15229.andres@anarazel.de> (raw)
In-Reply-To: <4D78FB98.7090609@nsoft.lt>
References: <4D78FB98.7090609@nsoft.lt>
On Thursday, March 10, 2011 05:26:00 PM Julius Tuskenis wrote:
> 3) As STABLE function should be executed once for every different set of
> parameters
Thats not true. Thats not what any of the volatility information (like STABLE,
IMMUTABLE, VOLATILE) does.
See http://www.postgresql.org/docs/current/interactive/xfunc-volatility.html
It *does* change how often a function is executed though. I.e.
SELECT g.i, some_stable_func(1) FROM generate_series(1, 1000) g(i)
will call some_stable_func only once because it can determine all the
parameters beforehand.
Andres
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: andres@anarazel.de, julius@nsoft.lt
Subject: Re: unexpected stable function behavior
In-Reply-To: <201103141508.15229.andres@anarazel.de>
* 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