Tom Lane wrote:
> I hadn't read it yet, but that makes it wrong already. There's no need
> for any new inval traffic --- the existing syscache inval messages on
> pg_proc entries should serve fine.
Yes, creating a new message type was a bit short sighted -- attached is a patch
that uses syscache invalidation messages instead. This also adds additional
tupleId field to SharedInvalCatcacheMsg. This is used to identify the
invalidated tuple in PROC messages, for now others still pass InvalidOid.
> More generally, if we are to try to invalidate on the strength of
> pg_proc changes, what of other DDL changes? Operators, operator
> classes, maybe? How about renaming a schema? I would like to see a
> line drawn between things we find worth trying to track and things we
> don't. If there is no such line, we're going to need a patch a lot
> larger than this one.
The attached patch registers callbacks for namespace, operator and op family
catalog changes. PlanCacheCallback now takes catalog id as arg and can
take actions depending on the catalog type. Adding new catalogs is just a
matter of registering the callback in InitPlanCache. Of course, only tables
and functions have exact tracking -- other changes just invalidate all.
I'm wondering if the list of catalogs to be tracked should be fixed at all.
Maybe it would be better to call PlanCacheCallback directly on any syscache
entry invalidation? This way no catalog would be overlooked and the
cache_callback_list could be kept nice and short. PlanCacheCallback would
receive the catalog id and OID of the invalidated tuple and could then
decide whether it can do precise invalidation, flush the cache or just
skip the event. What do you think?
In response to
pgsql-hackers by date
|Next:||From: Bernd Helmle||Date: 2008-08-28 10:07:25|
|Subject: What happend to equality_oper()|
|Previous:||From: Grant Finnemore||Date: 2008-08-28 08:36:37|
|Subject: Re: Proposal to sync SET ROLE and pg_stat_activity|