This text was automatically converted from troff me macros to HTML. Information may have been lost, added, or changed in the process. Lars Aronsson and Lysator do not guarantee the correctness of this HTML document.
cluster *
- give storage clustering advice to POSTGRES
cluster classname on attname [using operator ]
This command instructs POSTGRES to keep the class specified by classname approximately sorted on attname using the specified operator to determine the sort order. The operator must be a binary operator and both operands must be of type attname and the operator must produce a result of type boolean. If no operator is specified, then < is used by default.
A class can be reclustered at any time on a different attribute and/or with a different operator.
POSTGRES will try to keep the heap data structure which stores the instances of this class approximately in sorted order. If the user specifies an operator which does not define a linear ordering, this command will produce unpredictable orderings.
Also, if there is no index for the clustering attribute, then this command will have no effect.
/* cluster employees in salary order */ cluster emp on salary
Cluster has no effect in Version 4.0.