May 102021
 

Having written over 600 blog entries, I thought I would have already covered the complexities of the
CLUSTER command, but it seems I have not, so let’s do that now.

CLUSTER is an unusual SQL command because, like non-unique CREATE INDEX, it only affects performance. In fact,
CLUSTER requires the existence of an index. So, what does CLUSTER do? Well, what does CREATE INDEX do? Let’s look at how storage works in Postgres.

User data rows are stored in heap files in the file system, and those rows are stored in an indeterminate order. If the table is initially
loaded in INSERT/COPY order, later inserts, updates, and deletes will cause rows to be added in unpredictable order in the heap…

External feed Read More at the Source: https://postgr.es/p/54g

 2021-05-10  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)