Re: Eliminating VACUUM FULL WAS: remove flatfiles.c - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Eliminating VACUUM FULL WAS: remove flatfiles.c
Date
Msg-id m24oriz9hk.fsf@hi-media.com
Whole thread Raw
In response to Re: Eliminating VACUUM FULL WAS: remove flatfiles.c  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> The relcache need to be bootstrapped more than once, not just at
> initdb's bootstrap.  (I guess you could try a breakpoint in formrdesc)

Ok so in RelationCacheInitializePhase3 we have formrdesc calls:
    formrdesc("pg_class", false,              true, Natts_pg_class, Desc_pg_class);

That will do this:/* * initialize relation id from info in att array (my, this is ugly) */RelationGetRelid(relation) =
relation->rd_att->attrs[0]->attrelid;relation->rd_rel->relfilenode= RelationGetRelid(relation);
 

And this uses data from pg_attribute.h which looks like this:

#define Schema_pg_class \
{ 1259, {"relname"},       19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } },
\

So in the source I'm reading, pg_class relfilenode is 1259, the system
knows how to get there, then read real values instead of bootstrap mode
dummy one.

Except that the bootstrap mode is used at initdb, at system startup and
anytime there's a cache miss?

So to be able to CLUSTER we have to find a way for cache miss to get the
file named 1259 or the new value, whatever it is after CLUSTER changed
it. I guess symlinks are not allowed?

> Yeah, well, Tom just posted a possible solution :-)

Flat file are back? really?

Regards,
-- 
dim


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Eliminating VACUUM FULL WAS: remove flatfiles.c
Next
From: Tom Lane
Date:
Subject: Non-Solaris dtrace support is disabled in 8.4!!!?