Re: Fwd: [PATCH] Add zstd compression for TOAST using extended header format

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Dharin Shah <dharinshah95(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Nikhil Kumar Veldanda <veldanda(dot)nikhilkumar17(at)gmail(dot)com>
Subject: Re: Fwd: [PATCH] Add zstd compression for TOAST using extended header format
Date: 2026-03-09 06:02:08
Message-ID: aa5iYKdcq5ocyHgm@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers

On Tue, Jan 20, 2026 at 03:45:12PM +0900, Michael Paquier wrote:
> What I am pretty sure about at this stage is that there is little love
> for the patch set I have sent on the other thread where I have been
> using pointer redirections for the TOAST function calls with
> callbacks (perhaps I'll be able to apply some of the renaming patches
> anyway, nobody would scream at me for that), at least nobody has put a
> +1 on it or just ignored it, so this approach feels dead to me. What
> you are suggesting upthread, though, is a direction I'd like to dig
> into and this comes down to how I can unify what you want to do for
> zstd and what I want to do with Oid8. Perhaps that you are right and
> that it is just simpler to invest on an interface in the detoast code,
> but I still see that there is nothing done for the logical decoding or
> amcheck code paths, which is something my other patch is able to deal
> with transparently.

(Added Nikhil in CC.)

While looking at what could be achieved for this release, I have
hacked on a patch that removes the limitation of the GUC enum for
defailt_toast_compression, which is currently limited at 4 values due
to the two bits allocated in the varlenas, and finished with the
attached.

This relies on the concept of a compression method "registry", saved
in toast_compression.c, that includes 4 fields for each compression
method supported in TOAST:
- The attcompression attribute in catalogs, a char.
- The compression method name.
- The compression GUC enum value.
- The on-disk varlena value, now moved to varatt.h.

What do you think about this approach?
--
Michael

Attachment Content-Type Size
0001-Refactor-code-logic-around-TOAST-compression.patch text/plain 18.8 KB

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Hari Prasad 2026-03-21 18:52:35 [pgAdmin] Startup speed improvements + identified bottlenecks (related to issue #9770)
Previous Message Akshay Joshi 2026-03-05 08:39:00 pgAdmin 4 v9.13 Released

Browse pgsql-hackers by date

  From Date Subject
Next Message Shreeya Sharma 2026-03-09 06:03:27 Re: POC: PLpgSQL FOREACH IN JSON ARRAY
Previous Message Pavel Stehule 2026-03-09 05:53:05 unstable regress tests modules/injection_points/syscache-update-pruned