Re: Can this function be declared IMMUTABLE? - Mailing list pgsql-general

From Jaime Casanova
Subject Re: Can this function be declared IMMUTABLE?
Date
Msg-id c2d9e70e0708292215n4a185bbbg5a83863703310e38@mail.gmail.com
Whole thread Raw
In response to Can this function be declared IMMUTABLE?  (beickhof@Lexmark.com)
List pgsql-general
On 8/27/07, beickhof@lexmark.com <beickhof@lexmark.com> wrote:
> Well, I am considering a function that does read from a table, but the
> table contents change extremely infrequently (the table is practically a
> list of constants).  Would it be safe to declare the function IMMUTABLE
> provided that the table itself is endowed with a trigger that will drop
> and recreate the function any time the table contents are modified?  In
> this way, it seems that the database would gain the performance benefit of
> an immutable function for the long stretches of time in between changes to
> the table.
>

make the function STABLE instead

> I apologize that I don't have any details -- it is still very early in the
> development of the database design, and I was just hoping to get a better
> understanding of whether an immutable function would safely offer any
> benefit in this scenario.
>

do you know that early optimization is the root of all evil?

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: What kind of locks does vacuum process hold on the db?
Next
From: "Josh Tolley"
Date:
Subject: Re: Can this function be declared IMMUTABLE?