Re: Eliminating VACUUM FULL WAS: remove flatfiles.c

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, daveg(at)sonic(dot)net, Andrew Dunstan <andrew(at)dunslane(dot)net>, Greg Stark <gsstark(at)mit(dot)edu>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Eliminating VACUUM FULL WAS: remove flatfiles.c
Date: 2009-09-04 21:27:19
Message-ID: m24oriz9hk.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-04 21:49:51 Non-Solaris dtrace support is disabled in 8.4!!!?
Previous Message Tom Lane 2009-09-04 21:01:25 Re: Eliminating VACUUM FULL WAS: remove flatfiles.c