Skip site navigation (1) Skip section navigation (2)

ALTER Table and CLUSTER does adding a new column rewrite clustered? (8.4.3)

From: Scott Carey <scott(at)richrelevance(dot)com>
To: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: ALTER Table and CLUSTER does adding a new column rewrite clustered? (8.4.3)
Date: 2010-06-22 17:30:35
Message-ID: 37F2FA33-49B6-478D-BCFE-FD0DBC4CBBA8@richrelevance.com (view raw or flat)
Thread:
Lists: pgsql-performance
v. 8.4.3 

I have a table that has several indexes, one of which the table is clustered on.  If I do an ALTER TABLE Foo ADD COLUMN bar integer not null default -1;

It re-writes the whole table.

* Does it adhere to the CLUSTER property of the table and write the new version clustered?
* Does it properly write it with the FILLFACTOR setting?
* Are all the indexes re-created too, or are they bloated and need a REINDEX?

http://www.postgresql.org/docs/8.4/static/sql-altertable.html 
  does not seem to answer the above, it mentions the conditions that cause a rewrite but does not say what the state is after the rewrite with respect to CLUSTER, FILLFACTOR, and index bloat.

Thanks in advance!


Responses

pgsql-performance by date

Next:From: Anj AduDate: 2010-06-22 21:44:39
Subject: slow index lookup
Previous:From: Scott CareyDate: 2010-06-22 17:19:19
Subject: Re: raid10 write performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group