pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Introduce the REPACK command
Date: Tue, 10 Mar 2026 18:57:37 +0000
Message-ID: <E1w02Gv-003Lnl-1j@gemulon.postgresql.org> (raw)

Introduce the REPACK command

REPACK absorbs the functionality of VACUUM FULL and CLUSTER in a single
command.  Because this functionality is completely different from
regular VACUUM, having it separate from VACUUM makes it easier for users
to understand; as for CLUSTER, the term is heavily overloaded in the
IT world and even in Postgres itself, so it's good that we can avoid it.

We retain those older commands, but de-emphasize them in the
documentation, in favor of REPACK; the difference between VACUUM FULL
and CLUSTER (namely, the fact that tuples are written in a specific
ordering) is neatly absorbed as two different modes of REPACK.

This allows us to introduce further functionality in the future that
works regardless of whether an ordering is being applied, such as (and
especially) a concurrent mode.

Author: Antonin Houska <ah@cybertec.at>
Reviewed-by: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Robert Treat <rob@xzilla.net>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://postgr.es/m/82651.1720540558@antos
Discussion: https://postgr.es/m/202507262156.sb455angijk6@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ac58465e0618941842439eb3f5a2cf8bebd5a3f1

Modified Files
--------------
doc/src/sgml/monitoring.sgml             | 226 +++++++-
doc/src/sgml/ref/allfiles.sgml           |   1 +
doc/src/sgml/ref/cluster.sgml            |  99 +---
doc/src/sgml/ref/repack.sgml             | 330 ++++++++++++
doc/src/sgml/ref/vacuum.sgml             |  33 +-
doc/src/sgml/reference.sgml              |   1 +
src/backend/access/heap/heapam_handler.c |  32 +-
src/backend/catalog/index.c              |   2 +-
src/backend/catalog/system_views.sql     |  29 +-
src/backend/commands/cluster.c           | 889 ++++++++++++++++++++-----------
src/backend/commands/vacuum.c            |   6 +-
src/backend/parser/gram.y                |  86 ++-
src/backend/tcop/utility.c               |  29 +-
src/backend/utils/adt/pgstatfuncs.c      |   4 +-
src/bin/psql/tab-complete.in.c           |  43 +-
src/include/catalog/catversion.h         |   2 +-
src/include/commands/cluster.h           |   8 +-
src/include/commands/progress.h          |  50 +-
src/include/nodes/parsenodes.h           |  35 +-
src/include/parser/kwlist.h              |   1 +
src/include/tcop/cmdtaglist.h            |   1 +
src/include/utils/backend_progress.h     |   2 +-
src/test/regress/expected/cluster.out    | 137 ++++-
src/test/regress/expected/rules.out      |  72 ++-
src/test/regress/sql/cluster.sql         |  72 ++-
src/tools/pgindent/typedefs.list         |   2 +
26 files changed, 1650 insertions(+), 542 deletions(-)



Message-ID: <E1w02Gv-003Lnl-1j@gemulon.postgresql.org>
Permalink:  ../E1w02Gv-003Lnl-1j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w02Gv-003Lnl-1j@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Introduce the REPACK command
  In-Reply-To: <E1w02Gv-003Lnl-1j@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox