Toasted table not deleted when no out of line columns left

From: Zoltan Boszormenyi <zb(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Toasted table not deleted when no out of line columns left
Date: 2008-09-21 09:37:58
Message-ID: 48D615F6.7080308@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

we came across a database where a table had a toasted table,
keeping huge amounts of disk space allocated. However,
the table's current definition didn't explain why there was
a toasted table. Then upon some experiments, it struck me.
There _was_ a toasted field but as the schema was modified,
the fields was dropped, leaving only inline stored fields.
VACUUM [FULL] [ANALYZE] didn't cleaned up the space
that was used by the toasted table. My tests were done on 8.3.3.

As every statements that reference a table puts a lock on the
pg_class record, ALTER TABLE cannot progress until all locks
are gone, i.e. the transactions referencing the table finished.
It's true vice-versa, ALTER TABLE blocks every transactions
that may reference the table. Judging from that, the toasted table
cleanup may be part of ALTER TABLE DROP COLUMN.

Best regards,
Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-21 16:05:43 Re: Toasted table not deleted when no out of line columns left
Previous Message Simon Riggs 2008-09-21 09:18:08 Re: Foreign key constraint for array-field?