CatCache state reversing

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: CatCache state reversing
Date: 2004-05-14 23:53:42
Message-ID: 20040514235342.GA27354@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

In looking at the CatCache code it's clear to me that there's no point
in copying the whole structure like I did to the Relcache; it's much
bigger, and there's not much that can change inside a subtransaction:
CatCacheRemoveCTup can't be called, because ReleaseCatCache will not be
called more times than SearchCatCache was called. So it can, at most,
end with the same number of references.

What I'm currently thinking is that for each entry in the cache, we'll
save the current refcount at subtransaction start, and then restore it
at subtransaction abort. At subtransaction commit, the parent's
refcount will be updated with the subtransaction's refcount, which can
be greater than zero.

This will be done by adding an int* member to the catctup and catclist
structs, and keeping the integers there.

Comments?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"People get annoyed when you try to debug them." (Larry Wall)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-15 03:21:42 Re: relcache refcount
Previous Message Andrew Dunstan 2004-05-14 23:38:12 Re: Feature freeze approaching