Re: Toasted table not deleted when no out of line columns left - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Toasted table not deleted when no out of line columns left
Date
Msg-id 1222069586.4445.117.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Toasted table not deleted when no out of line columns left  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Toasted table not deleted when no out of line columns left
List pgsql-hackers
On Sun, 2008-09-21 at 12:05 -0400, Tom Lane wrote:

> ... and it goes on to point out how to force immediate space reclamation
> if you need that.  These statements apply independently of whether any
> particular value is toasted or not.
> 
> The reason for this choice is that reclaiming the space immediately
> would turn DROP COLUMN from a quick operation into a slow one, as it
> would have to grovel over every row of the table looking for TOAST
> pointers.
> 
> > Judging from that, the toasted table
> > cleanup may be part of ALTER TABLE DROP COLUMN.

I thought Hans meant cleanup, not drop?

Perhaps there is room for a function that scans a toast table to remove
unreferenced toast data? It could be done much more efficiently than the
UPDATE and VACUUM FULL technique. No need to add it into DROP COLUMN,
but that doesn't mean it shouldn't be available somewhere, somehow.

Hans is likely to write this anyway for his customer, so it seems worth
defining how it should look so we can accept it into core. VACUUM TOAST
perhaps?

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: macport for libpqxx
Next
From: Dimitri Fontaine
Date:
Subject: Re: parallel pg_restore