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 1tdrAi-00A5Wm-LD for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jan 2025 13:35:01 +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 1tdrAh-000ZLz-Nk for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jan 2025 13:34:59 +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 1tdrAh-000ZLr-0R for pgsql-hackers@lists.postgresql.org; Fri, 31 Jan 2025 13:34:59 +0000 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tdrAd-002WLq-0Z for pgsql-hackers@postgresql.org; Fri, 31 Jan 2025 13:34:58 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 979E611401AA; Fri, 31 Jan 2025 08:34:52 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Fri, 31 Jan 2025 08:34:52 -0500 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=fm3; t=1738330492; x=1738416892; bh=l YHQR3rfRrjrfR6vFfR4jVKzZ0x11BOyew4NDZXiNFg=; b=UlH5VWUqE5e8Apvt3 /09qGs/8x0CeKw4m01t6xtsAsDoZUcCy1CpnQMRqsoG+4QLqW+rjDWZFsSdwmav0 N7RGIdTgkwm6FhDpYli1CHPVVXg5uLl+fCwKsIHvmr1Kp7eCQtKwtT4o8v1jz+Fr +7kck7m2fIv0WLPCormihYKJanCvh4vQQfffn5zIxPif7NrcALxPz85ZyWXqVd1/ hUZ9un77G6Z/iOlK/aorWTwWMcOF2a6quM6/9S4RkqQkdOx0s4pzAmnbh/EjhIV8 rja5rlpi+u97bz1ismB6Vq+qPye6+K0WHFVp8UHyskUt2rUb1cBVafi+Gn2EjN6h fgLBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffh jeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggv rhhtvggtrdgrthdprhgtphhtthhopegsohgvkhgvfihurhhmodhpohhsthhgrhgvshesgh hmrghilhdrtghomhdprhgtphhtthhopehprghvvghlrdhsthgvhhhulhgvsehgmhgrihhl rdgtohhmpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpd hrtghpthhtohepiihhjhifphhkuhesghhmrghilhdrtghomhdprhgtphhtthhopehmsggr nhgtkhesghhmgidrnhgvthdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrd ighiiipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhl rdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 31 Jan 2025 08:34:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738330488; bh=bNDbFAxoL1bVryfmPBddO6wrPOv4pk5hXws7YT8c8pI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=VBhioqyLvUFPJHmj7o+y+TD5G33CtNoLSR+bkkyhoFiU++1FuBrzAk9R02HuwuBP7 u5r+d3NAHo5UMySW4P38I8TAtZJlx2tOx/OzZTMqzNqW8Cbl+ARGLJfPorwkxHX093 ucFmqwUZ2/4nZ0Jq2cv55i2QCN+WoeE7KC++jsIN/j4gJaL8jxXqHWdIsypay+IulQ WWW3tLt7t4//yWv2htDD64TLmCeHQIpgtFQC9gz3feTxjB92tsxNhAKVlQ8SxqbT2r 33yPgRUs0nlzLkYEnzcAMovCpUywDH6CTMV240vAfnwVdyn71VgueJPZd5wq+OHi4G t2LoYToZrZRzg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 96D4C8C; Fri, 31 Jan 2025 14:34:48 +0100 (CET) Date: Fri, 31 Jan 2025 14:34:48 +0100 From: Alvaro Herrera To: Antonin Houska Cc: Matthias van de Meent , Michael Banck , Junwang Zhao , Kirill Reshke , Pavel Stehule , Michael Paquier , PostgreSQL Hackers Subject: Re: why there is not VACUUM FULL CONCURRENTLY? Message-ID: <202501311334.za2d2icg37sr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <26221.1738326749@antos> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Jan-31, Antonin Houska wrote: > Matthias van de Meent wrote: > > First, due to the XLog-based change detection this feature can't work > > for unlogged tables without first changing them to logged (which > > implies first writing the whole table to XLog, to not cause issues on > > any replicas). However, documentation for this limitation seems to be > > missing from the patches, and I hope a solution can be found without > > requiring LOGGED. > > Currently I've got no idea how to handle UNLOGGED table. I'll at least fix the > documentation. Yeah, I think it should be possible, but it's going to require complicated additional changes to support. I suggest that in the first version we leave this out, and we can implement it afterwards. > > For (2), I think the scan needs a snapshot to guarantee we keep the > > original tuples of updates around, wich will hold back any other > > VACUUM activity in the database. > A single snapshot is used because there is a single stream of decoded data > changes. Thus a new version of a tuple is either visible to the snapshot or it > appears in the stream, but not both. I agree with Matthias that this is going to be a problem. In fact, if we need to keep the snapshot for long enough (depending on how long it takes to scan the table), then the snapshot that it needs to keep would disrupt vacuuming on all the other tables, causing more bloat. If it's bad enough (say because the table is big enough to take hours to repack and recreate the indexes on), the bloat situation might be worse after REPACK has completed than it was before. But -- again -- I think we need to limit the complexity of this patch, or otherwise we're never going to get it done. So I propose that in our first implementation we continue to use a single snapshot, and we can try to find ways to grab fresh snapshots from time to time as a later improvement on the patch. Customers in situations so bad that they can't use REPACK to fix their bloat in 18, are already unable to fix it in earlier versions, so this would not be a regression. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "No tengo por qué estar de acuerdo con lo que pienso" (Carlos Caszeli)