Re: invalidating cached plans - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: invalidating cached plans
Date
Msg-id 200503150106.j2F16kI20022@candle.pha.pa.us
Whole thread Raw
In response to Re: invalidating cached plans  (Harald Fuchs <use_reply_to@protecting.net>)
Responses Re: invalidating cached plans
Re: invalidating cached plans
List pgsql-hackers
Harald Fuchs wrote:
> In article <6028.1110785150@sss.pgh.pa.us>,
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> 
> > One possible approach is to do the invalidation on a sufficiently coarse
> > grain that we don't care.  For example, I would be inclined to make any
> > change in a table's schema invalidate all plans that use that table at
> > all; that would then subsume the constraint problem for instance.  This
> > doesn't solve the inlined function problem however.
> 
> How about using an even coarser grain?  Whenever something in the
> database in question changes, blindly throw away all cached plans for
> this DB.

We could, but the creation of a single temp table would invalidate all
caches, and temp table creation might be pretty frequent.

One idea would be to record if the function uses non-temp tables, temp
tables, or both, and invalidate based on the type of table being
invalidated, rather than the table name itself.  I can imagine this
hurting temp table caching, but at least functions using regular tables
would not be affected, and functions using temp tables would work
reliably.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Harald Fuchs
Date:
Subject: Re: invalidating cached plans
Next
From: Neil Conway
Date:
Subject: Re: invalidating cached plans