Re: "Healing" a table after massive updates

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Brad Nicholson <bnichols(at)ca(dot)afilias(dot)info>
Cc: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: "Healing" a table after massive updates
Date: 2008-09-11 14:35:34
Message-ID: 20080911143534.GB9492@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brad Nicholson wrote:

> If you want to compact the the table, you either need to use CLUSTER or
> VACUUM FULL + REINDEX.

Actually those are all pretty slow. If you can do a no-op ALTER TYPE
that rewrites the entire table, it is a lot faster. Something like

ALTER TABLE tab ALTER COLUMN col TYPE integer;

Assume that column "col" on table "tab" already has type integer.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2008-09-11 14:37:21 Re: "Healing" a table after massive updates
Previous Message Alvaro Herrera 2008-09-11 14:32:52 Re: psql scripting tutorials