Re: Clearing plans - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Clearing plans
Date
Msg-id b42b73150701191102t4b35464bj7bc359f56407e15b@mail.gmail.com
Whole thread Raw
In response to Clearing plans  (Scott Ribe <scott_ribe@killerbytes.com>)
Responses Re: Clearing plans
List pgsql-general
On 1/18/07, Scott Ribe <scott_ribe@killerbytes.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query Help
Next
From: "Jeremy Haile"
Date:
Subject: Re: Index bloat of 4x