CLUSTER micro-doc-patch

Started by Sergey E. Koposovabout 19 years ago2 messages
#1Sergey E. Koposov
math@sai.msu.ru
1 attachment(s)

Hello All,

Doing recently the CLUSTER operation with (SELECT .. ORDER BY ...) instead
of CLUSTER I realized that that operation requires the free space equal to
twice! the size of the table size :-( (which is unfortunately a serious
drawback of the SELECT method, comparing to the plain CLUSTER for
the large tables )...

So, I send the small doc-patch saying about the space requirement of the
cluster operation using SELECT ORDER BY.

Regards,
Sergey

*******************************************************************
Sergey E. Koposov
Max Planck Institute for Astronomy/Sternberg Astronomical Institute
Tel: +49-6221-528-349
Web: http://lnfm1.sai.msu.ru/~math
E-mail: math@sai.msu.ru

Attachments:

cluster-doc.patchtext/plain; charset=US-ASCII; name=cluster-doc.patchDownload
Index: doc/src/sgml/ref/cluster.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v
retrieving revision 1.37
diff -c -r1.37 cluster.sgml
*** doc/src/sgml/ref/cluster.sgml	31 Oct 2006 01:52:31 -0000	1.37
--- doc/src/sgml/ref/cluster.sgml	4 Nov 2006 13:14:19 -0000
***************
*** 153,160 ****
  
      which uses the <productname>PostgreSQL</productname> sorting code in 
      the <literal>ORDER BY</literal> clause to create the desired order; this is usually much
!     faster than an index scan for
!     unordered data. You then drop the old table, use
      <command>ALTER TABLE ... RENAME</command>
      to rename <replaceable class="parameter">newtable</replaceable> to the old name, and
      recreate the table's indexes. However, this approach does not preserve
--- 153,161 ----
  
      which uses the <productname>PostgreSQL</productname> sorting code in 
      the <literal>ORDER BY</literal> clause to create the desired order; this is usually much
!     faster than an index scan for unordered data (during that operation, you 
!     need free space on disk at least equal to two times the table size).
!     You then drop the old table, use
      <command>ALTER TABLE ... RENAME</command>
      to rename <replaceable class="parameter">newtable</replaceable> to the old name, and
      recreate the table's indexes. However, this approach does not preserve
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey E. Koposov (#1)
Re: CLUSTER micro-doc-patch

"Sergey E. Koposov" <math@sai.msu.ru> writes:

So, I send the small doc-patch saying about the space requirement of the
cluster operation using SELECT ORDER BY.

Added, along with some other minor editorial fixes.

regards, tom lane