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.96) (envelope-from ) id 1vYZAK-007Gnn-0w for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Dec 2025 00:25:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vYZAJ-0062Ye-0b for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Dec 2025 00:25:15 +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.96) (envelope-from ) id 1vYZAI-0062YT-2h for pgsql-hackers@lists.postgresql.org; Thu, 25 Dec 2025 00:25:15 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vYZAH-002bLA-12 for pgsql-hackers@lists.postgresql.org; Thu, 25 Dec 2025 00:25:15 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id BC5861D00120; Wed, 24 Dec 2025 19:25:11 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 24 Dec 2025 19:25:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1766622311; x=1766708711; bh=eEcX3rknvO J/oDOiyeaF4JOylGM1PtI0Kk+EDRHPKCc=; b=HeXF+3/J5EL/UZDZiNZ7puLfx1 Jt6bV350/GOx2b8hXNNeJ1koy3ppEK7kCN3xu9/C5LUNckN8B8Iv8FB6WJDzIg/U e9iGh0JttraKjJZ84QONEoQVhZpxin75hEyGRnjKPXQ5dMUjxJ8wpS0Gt9KYUnEp D6NjtktSwRVz/MYL1KxvTFUdzIGekbt/xbju7vbResfug85G6lKeqWJBPZBNqYcE Bi7l8MymzdrhRTFUcTQcDeaN7o0nKxlSdU66dLB/iBxYqvbtzZWBWICnHd3UE9Es SI/TdN8DOZerW4PwMMGOT7TKUxOtZk7j3CCe8HZ93kZVzwQE/t/eSfBMreYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1766622311; x=1766708711; bh=eEcX3rknvOJ/oDOiyeaF4JOylGM1PtI0Kk+ EDRHPKCc=; b=FERtQEimLeeTjI6HMheqHC/wdN9ZPyih5nZqPcjZJeBVOe+KpdX khAPDzzXo+ImBOrGgzLrCuegQJW26ZPWxwqoSO6ZkHSZbQ670gdgh30IgtAdy5jR 8QfuucardEYxnyg/U4Jr4HivAd4bRcAy+b1jYCb7YXmtTghJ2i+5LQZlXCUfL080 m9SFCYSxd65trFaGhK6ShkbgCLnncSPT42YCW2NHhUvLrUz2UlXVUnd7bJc9zRmC OoitNCzTiVo+7A+2RDqqcfv7Zxkr0Cb3T6aQQj7L/5IX+VtQNV9MyMaD6xKQFGyZ ckg97maTMenKF9c5SdYVPf1cHYR5K64R4ng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeigedufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtroertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeffudelheeghfekfefgfedthfekuddt vdfhudekgeegheeikefflefhleekheetfeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrohgsse igiihilhhlrgdrnhgvthdprhgtphhtthhopeguhhgrrhhinhhshhgrhhelheesghhmrghi lhdrtghomhdprhgtphhtthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdprh gtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhq lhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Dec 2025 19:25:09 -0500 (EST) Date: Thu, 25 Dec 2025 09:24:57 +0900 From: Michael Paquier To: Robert Treat Cc: Dharin Shah , Peter Eisentraut , pgsql-hackers@lists.postgresql.org Subject: Re: Fwd: [PATCH] Add zstd compression for TOAST using extended header format Message-ID: References: <4c70b0f6-5aba-464c-b145-464a620c1222@eisentraut.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8r7zBwB7NlGaH++d" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --8r7zBwB7NlGaH++d Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 24, 2025 at 11:50:48AM -0500, Robert Treat wrote: > Agreed that I can't see pglz being removed any time soon, if ever. > Thinking through what a conversion process would look like seems > unwieldy at best, so I think we definitely need it for backwards > compatibility, plus I think it is useful to have a self-contained > option. I'd almost suggest we should look at replacing lz4, but I > don't think that is significantly easier, it just has a smaller, more > invested, blast radius. Backward-compatibility requirements make a replacement of LZ4 basically impossible to me, for the same reasons as pglz. We could not replace the bit used in the va_extinfo to track if LZ4 compression is used, either. One thing that I do wonder is if it would make things simpler in the long-run if we introduced a new separated vartag for LZ4-compressed external TOAST pointers as well. At least we'd have a leaner design: it means that we have to keep the varatt_external available on read, but we could update to the new format when writing entries. Or perhaps that's not worth the complication based on the last sentence you are writing.. =20 > That said, I do suspect ztsd could quickly > become a popular recommendation and/or default among users / > consultants / service providers. =2E. Because I strongly suspect that this is going to be true, and that zstd would just be a better replacement over lz4. That's a trend that I see is already going on for wal_compression. Note that I am not on board with simply reusing varatt_external for zstd-compressed entries, neither do I think that this is the best move ever. It makes the core patch simpler, but it makes things like ToastCompressionId more complicated to think about. If anything, I'd consider a rename of varatt_external as the best way to go with an intermediate "translation" structure only used in memory as I am proposing on the other thread (something that others seem meh enough about but I am not seeing alternate proposals floating around, either). This would make things like detoast_external_attr() less confusing, I think, as the latest patch posted on this thread is actually proving with its shortcut for toast_fetch_datum as one example of something I'd rather not do.. -- Michael --8r7zBwB7NlGaH++d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlMhFkACgkQnvQgOdby QH0I4w//cCUPeuGOaThmSkPd9+Xxhw3LDucEPzcZyLV37QZZbbP5QlyJPcpa24pM DAMtGFUknPwuM8lhHje1+9JbKs6oe9udwcYz0fGNkX+krTgiKisqOB/VYNipnT75 NuiHCt9g9J4H8JkcrVx6UPXmwzu0sbjoCgq4JNHX6COrc2Walcp/voiWuBqfxyVw uP7P6mZMUkKDpTyikS2McJz15W5oO1sdVbR1tJuUI/wGbYgumbA768UsSpkDUnvV 0vPBJYkQhmQXkgk0Nrum28KovgqC7oTi86xfex8W8IOW4rmY77DUSyZaZfeqHV6i wlbzz3Ydg6LIu6WfFwEXSKkZx31ipR40a59o4mD2Sk6ky0VidKfxe64AN4g3uVu/ KREB72PWqhOjFQnT/Tewzg1C3kIJvKcOfVkNQqFQDgfS5V0OVLQMugYE+O+uN2JO M+gbU+4FaFWkX+ws+XMiMATlnuaR7KyMF1VWDRsruWFKYS5gTLOIJn/hdarxdGH2 J8T9qnappjxU6vXxcdnwjAQUjSw6tZIZAeJk1t2CU84osgJYDB70f0m85ARzqyrE DSCoBwPaUzQO6tXaajPq4ueojRMU8ArIOMVq2F9D1298vxXnE/gGEdwmdPIGbsqK cqbcoVmfpjQ3vRItzupoVtOYmSSwLPg6lmZ8aF5j3U83XxZORlU= =apCB -----END PGP SIGNATURE----- --8r7zBwB7NlGaH++d--