relcache refcount

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: relcache refcount
Date: 2004-05-13 03:52:29
Message-ID: 20040513035229.GA25233@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

I'm stuck trying to figure out how to decrease reference counting for
relcache entries at subtransaction abort.

Initially I thought I could just drop them all to zero, because a
subtransaction boundary should be enough warranty that the entries are
no longer needed. However I now think this is bogus, because maybe a
function could open a new transaction and abort it; and a surrounding
query would need the previous relcache entry. So this cannot possibly
work (if I'm wrong I'll be very happy because this is the easiest way).

Keeping a list of all entries the current subtrans holds and its local
refcount sounds ridiculous, doesn't it? We would need one hash per
subtransaction; this is very bad.

Any ideas out there?

Incidentally, I assume that LWLocks are not going to be needed across
subtransaction boundaries -- I release them all on abort, just as it's
done on main transaction abort. Same for catcache entries. Does anyone
think this is incorrect?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No hay cielo posible sin hundir nuestras raíces
en la profundidad de la tierra" (Malucha Pinto)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-05-13 05:30:32 anoncvs moved
Previous Message Larry Rosenman 2004-05-13 03:19:23 Re: threads stuff/UnixWare