Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7B5F36439BC for ; Tue, 22 Jun 2010 14:30:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 27050-04 for ; Tue, 22 Jun 2010 17:30:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EXHUB018-4.exch018.msoutlookonline.net (exhub018-4.exch018.msoutlookonline.net [64.78.17.19]) by mail.postgresql.org (Postfix) with ESMTP id 358E9636780 for ; Tue, 22 Jun 2010 14:30:25 -0300 (ADT) Received: from EXVMBX018-1.exch018.msoutlookonline.net ([64.78.17.47]) by EXHUB018-4.exch018.msoutlookonline.net ([64.78.17.19]) with mapi; Tue, 22 Jun 2010 10:30:24 -0700 From: Scott Carey To: postgres performance list Date: Tue, 22 Jun 2010 10:30:35 -0700 Subject: ALTER Table and CLUSTER does adding a new column rewrite clustered? (8.4.3) Thread-Topic: ALTER Table and CLUSTER does adding a new column rewrite clustered? (8.4.3) Thread-Index: AcsSMJgjGa/f8mhkQhmFVI72VnTZDQ== Message-ID: <37F2FA33-49B6-478D-BCFE-FD0DBC4CBBA8@richrelevance.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201006/379 X-Sequence-Number: 39235 v. 8.4.3=20 I have a table that has several indexes, one of which the table is clustere= d 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 ver= sion clustered? * Does it properly write it with the FILLFACTOR setting? * Are all the indexes re-created too, or are they bloated and need a REINDE= X? http://www.postgresql.org/docs/8.4/static/sql-altertable.html=20 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!