Search Postgresql Archives

Re: Can this function be declared IMMUTABLE?

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

 



"Tom Lane" <tgl@xxxxxxxxxxxxx> writes:

> beickhof@xxxxxxxxxxx writes:
>> Well, I am considering a function that does select 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?
>
> What you'd want to do is restart all existing sessions so that any plans
> made using precomputed function values are discarded.  The trigger you
> suggest is fairly pointless because it will not cause regeneration of
> plans.

The trigger would alert him if there were any indexes built using the
function...


-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux