Re: Toasted table not deleted when no out of line columns left

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zoltan Boszormenyi <zb(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Re: Toasted table not deleted when no out of line columns left
Date: 2008-09-22 07:46:26
Message-ID: 1222069586.4445.117.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2008-09-22 07:53:16 Re: parallel pg_restore
Previous Message Dave Page 2008-09-22 07:30:00 Re: [HACKERS] macport for libpqxx