Re: VACUUM FULL versus TOAST

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: VACUUM FULL versus TOAST
Date: 2011-08-14 16:15:43
Message-ID: 27120.1313338543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-08-14 17:02:49 Re: Connection Problem
Previous Message Robert Haas 2011-08-14 15:47:35 Re: our buffer replacement strategy is kind of lame