Re: unexpected stable function behavior

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Cc: Julius Tuskenis <julius(at)nsoft(dot)lt>
Subject: Re: unexpected stable function behavior
Date: 2011-03-14 14:08:14
Message-ID: 201103141508.15229.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message runner 2011-03-14 15:54:39 Re: Tuning massive UPDATES and GROUP BY's?
Previous Message Merlin Moncure 2011-03-14 13:41:38 Re: unexpected stable function behavior