Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1usPjL-004nyZ-3i for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Aug 2025 17:51:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1usPjK-00GDuB-7x for pgsql-hackers@arkaria.postgresql.org; Sat, 30 Aug 2025 17:51:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1usPjJ-00GDrS-6l for pgsql-hackers@lists.postgresql.org; Sat, 30 Aug 2025 17:51:10 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1usPjD-002hkw-0n for pgsql-hackers@lists.postgresql.org; Sat, 30 Aug 2025 17:51:09 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5B9661400081; Sat, 30 Aug 2025 13:51:00 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sat, 30 Aug 2025 13:51:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1756576260; x=1756662660; bh=4 +bMEr1yQ7HYvILXywCO+wizDnI/n3nwZkIRkpxWhYA=; b=VOgKNPYE+sD7jo8pF 5YKSnrbDFhXSdMYgxcerIYIQGdewQXEdjqWAVUrj7tsgRjvemTmCn12C0ntOPz+w B+oewJ+N+dyrlsCzJ9g0LO5hB3D4Qe+W8wmSYC9dMNY6x4mMANqaHNOTt5ru1zvz 1/o4UcSPL4UVimRWZ+oFmg4/IlYWoGEP6Txrwx6it51CA8wYHGoHpvwPm8/pIAm+ GciLqSFN++lElEJ6mtJ+0GOnu3k4GI1IE/snpXYAlcmo3eqQm1r+Wr/I1Kd35Oq/ z8B4+Ez4/F80mzt+JTXiQl0/escbLUCFnHkk5jWhWuHpA0GjdjyvIEkanAtwvMnq l9AUw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddukeejtdegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudelkeekgfdttdettdekgfduvdeiffelteegjeeihfetheek veeftedtuddvhfeunecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeehpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphht thhopehmrghsrghordhfuhhjihhisehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhihh grihhlnhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtth hopehrohgsseigiihilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 30 Aug 2025 13:50:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1756576256; bh=0ifF0RZQKXSiIofOdIMIzJzVhA6VD4R+cMa9iburrjY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=aYCGkv+3c/Uan9Sl/d3rqiJx5Eh3kmWO95EYlDh9KuK7sDvq4ILkHfe6gLDWraQqs zOj8fEnQUHWxyikFepk4akeIdnMpsWBuYlh/kItpJqoztsJXJZ+h41UZdpaGaB9Dyg A9MCRYm/ZZsOKqK9Ru5Alkkj6wlJ4eBKhaUScJan2XRmHxGUkAtYjq2L3u/Nyz8kcw yptWQhKPgg/WQltdF9Px+4IEHGTT0A4aWMorAGOCDxV2yHYvva1wLvkzDMLkeEUqeL 4R5N1/CPnaYwG47pSCtyHLGEdyyddeYs767ltGSah2YQjgIMvdtZBY85YhVIU7vum3 i21+E6F510U6g== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 4831390; Sat, 30 Aug 2025 19:50:56 +0200 (CEST) Date: Sat, 30 Aug 2025 19:50:56 +0200 From: Alvaro Herrera To: Pg Hackers , Antonin Houska Cc: Robert Treat , Fujii Masao , Mihail Nikalayeu Subject: Re: Adding REPACK [concurrently] Message-ID: <202508301750.cbohxyy2pcce@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ipmcfwv2cm3fpxaf" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202507262156.sb455angijk6@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ipmcfwv2cm3fpxaf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, Here's v19 of this patchset. This is mostly Antonin's v18. I added a preparatory v19-0001 commit, which splits vacuumdb.c to create a new file, vacuuming.c (and its header file vacuuming.h). If you look at it under 'git show --color-moved=zebra' you should notice that most of it is just code movement; there's hardly any code changes. v19-0002 has absorbed Antonin's v18-0005 (the pg_repackdb binary) together with the introduction of the REPACK command proper; but instead of using a symlink, I just created a separate pg_repackdb.c source file for it and we compile that small new source file with vacuuming.c to create a regular binary. BTW the meson.build changes look somewhat duplicative; maybe there's a less dumb way to go about this. (For instance, maybe just have libscripts.a include vacuuming.o, though it's not used by any of the other programs in that subdir.) I'm not wedded to the name "vacuuming.c"; happy to take suggestions. After 0002, the pg_repackdb utility should be ready to take clusterdb's place, and also vacuumdb --full, with one gotcha: if you try to use pg_repackdb with an older server version, it will fail, claiming that REPACK is not supported. This is not ideal. Instead, we should make it run VACUUM FULL (or CLUSTER); so if you have a fleet including older servers you can use the new utils there too. All the logic for vacuumdb to select tables to operate on has been moved to vacuuming.c verbatim. This means this logic applies to pg_repackdb as well. As long as you stick to repacking a single table this is okay (read: it won't be used at all), but if you want to use parallel mode (say to process multiple schemas), we might need to change it. For the same reason, I think we should add an option to it (--index[=indexname]) to select whether to use the USING INDEX clause or not, and optionally indicate which index to use; right now there's no way to select which logic (cluster's or vacuum full's) to use. Then v19-0003 through v19-0005 are Antonin's subsequent patches to add the CONCURRENTLY option; I have not reviewed these at all, so I'm including them here just for completion. I also included v18-0006 as posted by Mihail previously, though I have little faith that we're going to include it in this release. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Pensar que el espectro que vemos es ilusorio no lo despoja de espanto, sólo le suma el nuevo terror de la locura" (Perelandra, C.S. Lewis) --ipmcfwv2cm3fpxaf Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v19-0001-Split-vacuumdb-to-create-vacuuming.c-h.patch"