|
1 | 1 | .\" This is -*-nroff-*-
|
2 | 2 | .\" XXX standard disclaimer belongs here....
|
3 |
| -.\" $Header: /cvsroot/pgsql/src/man/Attic/cluster.l,v 1.5 1998/03/14 21:57:56 momjian Exp $ |
| 3 | +.\" $Header: /cvsroot/pgsql/src/man/Attic/cluster.l,v 1.6 1998/03/14 22:55:21 momjian Exp $ |
4 | 4 | .TH CLUSTER SQL 01/23/93 PostgreSQL PostgreSQL
|
5 | 5 | .SH NAME
|
6 | 6 | cluster - give storage clustering advice to Postgres
|
@@ -48,11 +48,12 @@ unordered, the entries are on random pages, so there is one disk page
|
48 | 48 | retrieved for every row moved. PostgreSQL has a cache, but the majority
|
49 | 49 | of a big table will not fit in the cache.
|
50 | 50 | .PP
|
51 |
| -Another way is to use SELECT ... INTO TABLE temp FROM ... This uses the |
52 |
| -PostgreSQL sorting code, and is much faster for unordered data. You |
53 |
| -then drop the old table, use ALTER TABLE RENAME to rename 'temp' to the |
54 |
| -old name, and recreate the indexes. From then on, CLUSTER should be |
55 |
| -fast because most of the heap data is ordered. |
| 51 | +Another way is to use SELECT ... INTO TABLE temp FROM ...ORDER BY ... |
| 52 | +This uses the PostgreSQL sorting code in ORDER BY to match the index, |
| 53 | +and is much faster for unordered data. You then drop the old table, use |
| 54 | +ALTER TABLE RENAME to rename 'temp' to the old name, and recreate the |
| 55 | +indexes. From then on, CLUSTER should be fast because most of the heap |
| 56 | +data has been already ordered. |
56 | 57 | .SH EXAMPLE
|
57 | 58 | .nf
|
58 | 59 | /*
|
|
0 commit comments