November 2019
Beginner to intermediate
470 pages
11h 59m
English
In PostgreSQL, there is a command called CLUSTER that allows us to rewrite a table in the desired order. It is possible to point to an index and store data in the same order as the index:
test=# \h CLUSTERCommand: CLUSTERDescription: cluster a table according to an indexSyntax:CLUSTER [VERBOSE] table_name [ USING index_name ]CLUSTER [VERBOSE]URL: https://www.postgresql.org/docs/12/sql-cluster.html
The CLUSTER command has been around for many years and serves its purpose well. However, there are some things to consider before blindly running it on a production system:
Read now
Unlock full access