Re: changeset generation v5-01 - Patches & git tree - Mailing list pgsql-hackers

From Andres Freund
Subject Re: changeset generation v5-01 - Patches & git tree
Date
Msg-id 20130707173731.GC2062@alap2.anarazel.de
Whole thread Raw
In response to Re: changeset generation v5-01 - Patches & git tree  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: changeset generation v5-01 - Patches & git tree
List pgsql-hackers
On 2013-06-28 21:47:47 +0200, Andres Freund wrote:
> So, from what I gather there's a slight leaning towards *not* storing
> the relation's oid in the WAL. Which means the concerns about the
> uniqueness issues with the syscaches need to be addressed. So far I know
> of three solutions:
> 1) develop a custom caching/mapping module
> 2) Make sure InvalidOid's (the only possible duplicate) can't end up the
>    syscache by adding a hook that prevents that on the catcache level
> 3) Make sure that there can't be any duplicates by storing the oid of
>    the relation in a mapped relations relfilenode

So, here's 4 patches:
1) add RelationMapFilenodeToOid()
2) Add pg_class index on (reltablespace, relfilenode)
3a) Add custom cache that maps from filenode to oid
3b) Add catcache 'filter' that ensures the cache stays unique and use
    that for the mapping
4) Add pg_relation_by_filenode() and use it in a regression test

3b) adds an optional 'filter' attribute to struct cachedesc in
    syscache.c which is then passed to catcache.c. If it's existant
    catcache.c uses it - after checking for a match in the cache - to
    check whether the queried-for value possibly should end up in the
    cache. If not it stores a whiteout entry as currently already done
    for nonexistant entries.
    It also reorders some catcache.h struct attributes to make sure
    we're not growing them. Might make sense to apply that
    independently, those are rather heavily used.

I slightly prefer 3b) because it's smaller, what's your opinions?

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: strange IS NULL behaviour
Next
From: Markus Wanner
Date:
Subject: Re: Review: extension template