Re: [PATCHES] Non-transactional pg_class, try 2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Non-transactional pg_class, try 2
Date
Msg-id 13541.1150154114@sss.pgh.pa.us
Whole thread Raw
Responses Re: [PATCHES] Non-transactional pg_class, try 2  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
[ moving to -hackers to get some more eyeballs on the question ]

Simon Riggs <simon@2ndquadrant.com> writes:
> On Sun, 2006-06-11 at 17:53 -0400, Alvaro Herrera wrote:
>> Here I repost the patch to implement non-transactional catalogs, the
>> first of which is pg_ntclass, intended to hold the non-transactional
>> info about pg_class (reltuples, relpages).

> Will a user be able to update reltuples and relpages manually?

No, which is a tad annoying now that you mention it.  I'm not sure that
there's any very good reason for users to want to do that, though.  Once
or twice I've hacked those fields manually to set up test cases for the
planner, which is why I'd be annoyed to lose the ability --- but does it
really matter to users?  (Especially in view of the fact that the
planner no longer trusts relpages anyway.)

It does seem like rather a lot of mechanism and overhead though,
especially in view of Alvaro's worries about the non-cacheability of
pg_class_nt rows.  I wonder whether we shouldn't take two steps back
and rethink.

The main thing we are trying to accomplish here is to decouple
transactional and nontransactional updates to a pg_class row.
Is there another way to do that?  Do we need complete decoupling?
It strikes me that the only case where we absolutely must not lose a
nontransactional update is where we are un-freezing a frozen rel.
If we could guarantee that un-freezing happens before any transactional
update within a particular transaction, then maybe we could have that.
Manual updates to pg_class seem like they'd risk breaking such a
guarantee, but maybe there's a way around that.  Personally I'd be
willing to live with commands that try to modify a frozen rel erroring
out if they see the current pg_class row is uncommitted.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extended SERIAL parsing
Next
From: Tom Lane
Date:
Subject: Re: longjmp in psql considered harmful