Re: Clearing plans

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Scott Ribe" <scott_ribe(at)killerbytes(dot)com>
Cc: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Clearing plans
Date: 2007-01-19 19:02:16
Message-ID: b42b73150701191102t4b35464bj7bc359f56407e15b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/18/07, Scott Ribe <scott_ribe(at)killerbytes(dot)com> wrote:
> Is there a way to force a flush of all cached plans? Particularly, to force
> re-evaluation of immutable stored procedures? Don't worry, it's a testing &
> development thing, not something I want to do during production ;-)

Also, somebody correct me if I'm off my rocker here, but immutable
procedures are re-evaluated for each execution...they are just folded
into a constant during plan phase. To demonstrate this:

create temp sequence s;
postgres=# create function f() returns void as $$ select nextval('s');
$$ language sql;
create view v as select * from f();
create function g() returns bigint as $$ begin return f(); end; $$
language plpgqsl;
select * from v;
f
---
1
(1 row)

postgres=# select * from v;
f
---
2
(1 row)

postgres=# select g();
g
---
3
(1 row)

postgres=# select g();
g
---
4
(1 row)

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Haile 2007-01-19 19:03:28 Re: Index bloat of 4x
Previous Message Richard Troy 2007-01-19 18:58:38 Re: Spam from EnterpriseDB?