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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)krosing(dot)net>
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-24 01:58:36
Message-ID: 16699.1222221516@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)krosing(dot)net> writes:
> On Sun, 2008-09-21 at 12:05 -0400, Tom Lane wrote:
>> The DROP COLUMN form does not physically remove the column, but
>> simply makes it invisible to SQL operations. Subsequent insert and
>> update operations in the table will store a null value for the
>> column. Thus, dropping a column is quick but it will not immediately
>> reduce the on-disk size of your table, as the space occupied by the
>> dropped column is not reclaimed. The space will be reclaimed over
>> time as existing rows are updated.

> And it seems that it is never reclaimed (instead of "reclaimed over
> time" as claimed in docs) if the column happens to have been toasted.

Utterly false. The toasted values will be deletable after their parent
rows have been updated. This is exactly the same as for space in the
parent row itself.

> how do you explain the above "VACUUM [FULL] [ANALYZE] didn't cleaned up
> the space" claim ?

He didn't do any updates in the parent table.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-24 02:16:34 Re: pg_type.h regression?
Previous Message Tom Lane 2008-09-24 01:56:46 Re: [HACKERS] 0x1A in control file on Windows