Re: IMMUTABLE STABLE functions, daily updates - Mailing list pgsql-performance

From Thom Brown
Subject Re: IMMUTABLE STABLE functions, daily updates
Date
Msg-id CAA-aLv6HcRvYLHcHYuw2YY4Tfx+zBn5f6WsmGEzjSJSxPMErtg@mail.gmail.com
Whole thread Raw
In response to IMMUTABLE STABLE functions, daily updates  (Sorin Dudui <sd@wigeogis.com>)
Responses Re: IMMUTABLE STABLE functions, daily updates
List pgsql-performance
On 10 November 2011 13:05, Sorin Dudui <sd@wigeogis.com> wrote:
> Hi,
>
>
>
> I have some functions that select data from tables which are daily or
> monthly updated.  My functions are marked as STABLE. I am wondering if they
> perform better if I mark they as IMMUTABLE?

No.  IMMUTABLE is only appropriate when there is no access to table
data from within the function.  An example of IMMUTABLE functions
would be  mathematical operations, where only the inputs and/or
function constants are used to produce a result.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-performance by date:

Previous
From: Sorin Dudui
Date:
Subject: IMMUTABLE STABLE functions, daily updates
Next
From: Jay Levitt
Date:
Subject: Re: Subquery in a JOIN not getting restricted?