Re: why there is not VACUUM FULL CONCURRENTLY?
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Antonin Houska <ah@cybertec.at>
Cc: Matheus Alcantara <matheusssilv97@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, 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-06-07T14:41:35Z
Lists: pgsql-hackers
On Fri, Apr 11, 2025 at 5:28 PM Antonin Houska <ah@cybertec.at> wrote:
>
> Please check the next version [1]. Thanks for your input.
>
> [1] https://www.postgresql.org/message-id/97795.1744363522%40localhost
>
Hi, I’ve briefly experimented with v13-0001.
EXPLAIN tab complete:
explain (verbose O
OFF ON
since we already touched the tab-complete for repack.
We can do it similarly.
you may see src/bin/psql/tab-complete.in.c line 4288.
------------------------------
Currently REPACK Synopsis section
looks like the screenshot attached.
make it one line
REPACK [ ( option [, ...] ) ] [ table_name [ USING INDEX index_name ] ]
would look intuitive, IMHO.
------------------------------
+repack_index_specification:
+ USING INDEX name { $$ = $3; }
+ | /*EMPTY*/ { $$ = NULL; }
+ ;
in gram.y line 4685, we have
ExistingIndex: USING INDEX name { $$ = $3; }
;
so here, we can change it to
repack_index_specification:
ExistingIndex
| /*EMPTY*/ { $$ = NULL; }
-------------------------------------------------
+static List *
+get_tables_to_repack(MemoryContext repack_context)
+{
+ relrelation = table_open(RelationRelationId, AccessShareLock);
+ scan = table_beginscan_catalog(relrelation, 0, NULL);
+ while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
+ {
+ RelToCluster *rtc;
+ Form_pg_class relrelation = (Form_pg_class) GETSTRUCT(tuple);
+ Oid relid = relrelation->oid;
+
+ /* Only interested in relations. */
+ if (get_rel_relkind(relid) != RELKIND_RELATION)
+ continue;
The doc said (Without a table_name, REPACK processes every table and
materialized view...)
but seems plain ``REPACK(verbose) ; ``
will not process materialized view?
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