aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-11-15 03:09:39 +0000
committerBruce Momjian <bruce@momjian.us>2002-11-15 03:09:39 +0000
commit8bc717cb8878ff2baee4e29553736fab57248436 (patch)
tree69fb91e37bc3cd3d19e9aa529e3f03002ddf3719 /doc/src
parent5b7eb4dd45359e040cd7175f1b3cfc5ea28ad138 (diff)
downloadpostgresql-8bc717cb8878ff2baee4e29553736fab57248436.tar.gz
postgresql-8bc717cb8878ff2baee4e29553736fab57248436.zip
New version attached. The following is implemented:
- CLUSTER ALL clusters all the tables that have some index with indisclustered set and the calling user owns. - CLUSTER tablename clusters the named table, using the index with indisclustered set. If no index has the bit set, throws elog(ERROR). - The multi-relation version (CLUSTER ALL) uses a multitransaction approach, similar to what VACUUM does. Alvaro Herrera
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/cluster.sgml41
1 files changed, 38 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/cluster.sgml b/doc/src/sgml/ref/cluster.sgml
index e7aaa522811..a49d4d7d396 100644
--- a/doc/src/sgml/ref/cluster.sgml
+++ b/doc/src/sgml/ref/cluster.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.20 2002/09/21 18:32:54 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.21 2002/11/15 03:09:35 momjian Exp $
PostgreSQL documentation
-->
@@ -22,6 +22,8 @@ PostgreSQL documentation
</refsynopsisdivinfo>
<synopsis>
CLUSTER <replaceable class="PARAMETER">indexname</replaceable> ON <replaceable class="PARAMETER">tablename</replaceable>
+CLUSTER <replaceable class="PARAMETER">tablename</replaceable>
+CLUSTER ALL
</synopsis>
<refsect2 id="R2-SQL-CLUSTER-1">
@@ -104,6 +106,20 @@ CLUSTER
periodically re-cluster by issuing the command again.
</para>
+ <para>
+ When a table is clustered, <productname>PostgreSQL</productname>
+ remembers on which index it was clustered. In calls to
+ <command>CLUSTER <replaceable class="parameter">tablename</replaceable></command>,
+ the table is clustered on the same index that it was clustered before.
+ </para>
+
+ <para>
+ In calls to <command>CLUSTER ALL</command>, all the tables in the database
+ that the calling user owns are clustered using the saved information. This
+ form of <command>CLUSTER</command> cannot be called from inside a
+ transaction or function.
+ </para>
+
<refsect2 id="R2-SQL-CLUSTER-3">
<refsect2info>
<date>1998-09-08</date>
@@ -141,8 +157,15 @@ CLUSTER
</para>
<para>
- CLUSTER preserves GRANT, inheritance, index, foreign key, and other
- ancillary information about the table.
+ <command>CLUSTER</command> preserves GRANT, inheritance, index, foreign
+ key, and other ancillary information about the table.
+ </para>
+
+ <para>
+ Because <command>CLUSTER</command> remembers the clustering information,
+ one can cluster the tables one wants clustered manually the first time, and
+ setup a timed event similar to <command>VACUUM</command> so that the tables
+ are periodically and automatically clustered.
</para>
<para>
@@ -192,6 +215,18 @@ SELECT <replaceable class="parameter">columnlist</replaceable> INTO TABLE <repla
<programlisting>
CLUSTER emp_ind ON emp;
</programlisting>
+ <para>
+ Cluster the employees relation using the same index that was used before:
+ </para>
+ <programlisting>
+CLUSTER emp;
+ </programlisting>
+ <para>
+ Cluster all the tables on the database that have previously been clustered:
+ </para>
+ <programlisting>
+CLUSTER ALL;
+ </programlisting>
</refsect1>
<refsect1 id="R1-SQL-CLUSTER-3">