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

From Marcos Pegoraro
Subject Re: CLUSTER vs. VACUUM FULL
Date
Msg-id CAB-JLwYPrJpYGqsQFDpiMf6UFKeT1zwagabdb-2V3x0G8DqNPQ@mail.gmail.com
Whole thread Raw
In response to Re: CLUSTER vs. VACUUM FULL  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: CLUSTER vs. VACUUM FULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Em dom., 21 de abr. de 2024 às 22:35, David Rowley <dgrowleyml@gmail.com> escreveu:

Both VACUUM FULL and CLUSTER go through a very similar code path. Both
use cluster_rel().  VACUUM FULL just won't make use of an existing
index to provide presorted input or perform a sort, whereas CLUSTER
will attempt to choose the cheapest out of these two to get sorted
results.

But wouldn't it be good that VACUUM FULL uses that index defined by Cluster, if it exists ? Maybe an additional option for VACUUM FULL ?
Because if I periodically reorganize all tables I have to run CLUSTER once, which will run on clustered tables, and VACUUM FULL on every table that is not clustered, because if I run VACUUM FULL for entire database it'll just ignore cluster index defined for every table. So, INDISCLUSTERED is used when running CLUSTER but is ignored when running VACUUM FULL.

regards
Marcos

pgsql-general by date:

Previous
From: Bagesh Kumar Singh
Date:
Subject: Re: Not able to grant access on pg_signal_backend on azure flexible server
Next
From: Tom Lane
Date:
Subject: Re: CLUSTER vs. VACUUM FULL