Re: CLUSTER vs. VACUUM FULL - Mailing list pgsql-general

From David G. Johnston
Subject Re: CLUSTER vs. VACUUM FULL
Date
Msg-id CAKFQuwYFHCf+cd=wxJmzRqezQKy8rAKv2_QyvipzE1qboBXXvw@mail.gmail.com
Whole thread Raw
In response to Re: CLUSTER vs. VACUUM FULL  (Ron Johnson <ronljohnsonjr@gmail.com>)
Responses Re: CLUSTER vs. VACUUM FULL
List pgsql-general


On Mon, Apr 22, 2024, 08:37 Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Mon, Apr 22, 2024 at 10:25 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Marcos Pegoraro <marcos@f10.com.br> writes:
> But wouldn't it be good that VACUUM FULL uses that index defined by
> Cluster, if it exists ?

No ... what would be the difference then?
 
What the VACUUM docs "should" do, it seems, is suggest CLUSTER on the PK, if the PK is a sequence (whether that be an actual sequence, or a timestamp or something else that grows monotonically).

That's because the data is already roughly in PK order.

If things are bad enough to require a vacuum full that doesn't seem like a good assumption.  Any insert-only table or one with a reduced fill-factor maybe.

David J 

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: adding a generated column to a table?
Next
From: Marcos Pegoraro
Date:
Subject: Re: CLUSTER vs. VACUUM FULL