Re: ALTER TABLE SET TABLESPACE and pg_toast

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "PostgreSQL" <martin(at)portant(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: ALTER TABLE SET TABLESPACE and pg_toast
Date: 2005-12-16 15:23:21
Message-ID: 26244.1134746601@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"PostgreSQL" <martin(at)portant(dot)com> writes:
> We're storing tif images in a table as bytea. We were running low on our
> primary space and moved several tables, including the one with the images,
> to a second tablespace using ALTER TABLE SET TABLESPACE.
> This moved quite cleaned out quite a bit of space on the original
> tablespace, but not as much as it should have. It does not appear that the
> corresponding pg_toast tables were moved.

I think you're mistaken; at least, the SET TABLESPACE code certainly
intends to move a table's toast table and index along with the table.
What's your evidence for saying it didn't happen, and which PG version
are you using exactly?

> 2) Also, is there a good way to determine which pg_toast tables are
> associated with any particular table and column?

pg_class.reltoastrelid and reltoastidxid. See
http://www.postgresql.org/docs/8.1/static/storage.html
http://www.postgresql.org/docs/8.1/static/catalog-pg-class.html

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Craig A. James 2005-12-16 16:49:21 Re: Overriding the optimizer
Previous Message Tomasz Rybak 2005-12-16 14:47:19 Re: Overriding the optimizer