Re: why there is not VACUUM FULL CONCURRENTLY?
Antonin Houska <ah@cybertec.at>
From: Antonin Houska <ah@cybertec.at>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Marcos Pegoraro <marcos@f10.com.br>, Michael Banck <mbanck@gmx.net>,
Junwang Zhao <zhjwpku@gmail.com>,
Kirill Reshke <reshkekirill@gmail.com>,
Pavel Stehule <pavel.stehule@gmail.com>,
Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-03T18:40:27Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > On 2025-Feb-26, Antonin Houska wrote: > > > @@ -403,39 +381,38 @@ cluster_rel(Relation OldHeap, Oid indexOid, ClusterParams *params) > > * would work in most respects, but the index would only get marked as > > * indisclustered in the current database, leading to unexpected behavior > > * if CLUSTER were later invoked in another database. > > + * > > + * REPACK does not set indisclustered. XXX Not sure I understand the > > + * comment above: how can an attribute be set "only in the current > > + * database"? > > */ > > Regarding this XXX comment, what's going on here is this: a CLUSTER > command needs to remember the index that a table is clustered on. We > keep track of this in pg_index.indisclustered. But pg_index is a local > relation, not shared across databases -- so the current CLUSTER command > can effect the update on the current database's pg_index only, not on > other databases. So if the user were to run CLUSTER on one database > specifying an index, then connect to another one and expect CLUSTER > without specifying an index to honor the previously specified index, > that would not work. Naturally this is only a problem for shared > catalogs. Not being able to handle this for shared catalogs is not a > big loss. Thanks for explanation. The reason I failed to understand this was probably that I tried to imagine something worse. -- Antonin Houska Web: https://www.cybertec-postgresql.com
Commits
-
Add CONCURRENTLY option to REPACK
- 28d534e2ae0a 19 (unreleased) landed
-
Introduce the REPACK command
- ac58465e0618 19 (unreleased) landed
-
Adjust signature of cluster_rel() and its subroutines
- cc811f92bac5 18.0 landed
-
Simplify signature of RewriteTable
- ebd8fc7e47fd 18.0 cited