Re: VACUUM FULL versus TOAST - Mailing list pgsql-hackers

From Tom Lane
Subject Re: VACUUM FULL versus TOAST
Date
Msg-id 27120.1313338543@sss.pgh.pa.us
Whole thread Raw
In response to Re: VACUUM FULL versus TOAST  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: VACUUM FULL versus TOAST
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 14.08.2011 01:13, Tom Lane wrote:
>> I am thinking that the most reasonable solution is instead to fix VACUUM
>> FULL/CLUSTER so that they don't change existing toast item OIDs when
>> vacuuming a system catalog.  They already do some pretty ugly things to
>> avoid changing the toast table's OID in this case, and locking down the
>> item OIDs too doesn't seem that much harder.  (Though I've not actually
>> looked at the code yet...)

> How about detoasting all datums before caching them? It's surprising 
> that a datum that is supposedly in a catalog cache, actually needs disk 
> access to use.

Don't really want to fix a VACUUM-FULL-induced problem by inserting
distributed overhead into every other operation.

There would be some merit in your suggestion if we knew that all/most
toasted columns would actually get fetched out of the catcache entry
at some point.  Then we'd only be moving the cost around, and might even
save something on repeated accesses.  But I don't think we know that.
In the specific example at hand (pg_statistic entries) it's entirely
plausible that the planner would only need the histogram, or only need
the MCV list, depending on the sorts of queries it was coping with.

There's also a concern of bloating the catcaches if we do that ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: our buffer replacement strategy is kind of lame
Next
From: Tom Lane
Date:
Subject: Re: Connection Problem