Re: Stored procedure declared as VOLATILE => no good optimization is done

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

 



> broadly speaking:
> *) function generates same output from inputs regardless of what's
> going on in the database, and has no side effects: IMMUTABLE

So can I say "if a function is marked IMMUTABLE, then it should never
modify database"? Is there any counter example?

> *) function reads (only) from tables, or is an immutable function in
> most senses but influenced from the GUC (or any other out of scope
> thing): STABLE

It seems if above is correct, I can say STABLE functions should never
modify databases as well.

> *) all other cases: VOLATILE (which is btw the default)
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

-- 
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