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

From Tom Lane
Subject Re: Toasted table not deleted when no out of line columns left
Date
Msg-id 16699.1222221516@sss.pgh.pa.us
Whole thread Raw
In response to Re: Toasted table not deleted when no out of line columns left  (Hannu Krosing <hannu@krosing.net>)
List pgsql-hackers
Hannu Krosing <hannu@krosing.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 0x1A in control file on Windows
Next
From: Tom Lane
Date:
Subject: Re: pg_type.h regression?