Re: unexpected stable function behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux