Skip to content

Commit 7dc40a2

Browse files
committed
Major improvement in CLUSTER which preserves table characteristics using
relfilenode. I sent the CLUSTER patch a few days ago and I think it was missed. I append it again, this time including the regression test files. For the committer, please note that you have to cvs add the files as they don't exist. Maybe add to the parallel and serial schedules also, but I don't know such stuff. Alvaro Herrera (<alvherre[a]atentus.com>)
1 parent 181ca96 commit 7dc40a2

File tree

4 files changed

+561
-85
lines changed

4 files changed

+561
-85
lines changed

doc/src/sgml/ref/cluster.sgml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.16 2002/04/23 02:07:15 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.17 2002/08/10 20:43:46 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -75,19 +75,6 @@ CLUSTER
7575
</varlistentry>
7676
<varlistentry>
7777
<term><computeroutput>
78-
ERROR: relation &lt;<replaceable class="PARAMETER">tablerelation_number</replaceable>&gt; inherits "<replaceable class="PARAMETER">table</replaceable>"
79-
</computeroutput></term>
80-
<listitem>
81-
<para>
82-
<comment>
83-
This is not documented anywhere. It seems not to be possible to
84-
cluster a table that is inherited.
85-
</comment>
86-
</para>
87-
</listitem>
88-
</varlistentry>
89-
<varlistentry>
90-
<term><computeroutput>
9178
ERROR: Relation <replaceable class="PARAMETER">table</replaceable> does not exist!
9279
</computeroutput></term>
9380
<listitem>
@@ -138,13 +125,6 @@ ERROR: Relation <replaceable class="PARAMETER">table</replaceable> does not exis
138125
Notes
139126
</title>
140127

141-
<para>
142-
The table is actually copied to a temporary table in index
143-
order, then renamed back to the original name. For this
144-
reason, all grant permissions and other indexes are lost
145-
when clustering is performed.
146-
</para>
147-
148128
<para>
149129
In cases where you are accessing single rows randomly
150130
within a table, the actual order of the data in the heap
@@ -194,6 +174,20 @@ SELECT <replaceable class="parameter">columnlist</replaceable> INTO TABLE <repla
194174
fast because most of the heap data has already been
195175
ordered, and the existing index is used.
196176
</para>
177+
178+
<para>
179+
During the cluster operation, a temporal table is created that contains
180+
the table in the index order. Due to this, you need to have free space
181+
on disk at least the size of the table itself, or the biggest index if
182+
you have one that is larger than the table.
183+
</para>
184+
185+
<para>
186+
As opposed to previous releases, CLUSTER does not lose GRANT,
187+
inheritance or foreign key information, and preserves indexes
188+
other than the one being used for the CLUSTER.
189+
</para>
190+
197191
</refsect2>
198192
</refsect1>
199193

0 commit comments

Comments
 (0)