Re: [HACKERS] Custom compression methods

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, David Steele <david(at)pgmasters(dot)net>, Ildus Kurbangaliev <i(dot)kurbangaliev(at)gmail(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [HACKERS] Custom compression methods
Date: 2021-03-01 05:56:49
Message-ID: CAFiTN-tnnd9i10v-7O-8zWAnT=q4-mBkq3mxOAs-CyvkyK+VVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 27, 2021 at 9:35 PM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>
> > Subject: [PATCH v28 3/4] Add default_toast_compression GUC
>
> This part isn't working. My first patch worked somewhat better: due to doing
> strcmp() with the default GUC, it avoided using the cached AM OID. (But it
> would've failed with more than 2 AMs, since the cache wasn't invalidated, since
> I couldn't tell when it was needed).
>
> Your patch does this:
>
> |postgres=# SET default_toast_compression=lz4 ;
> |postgres=# CREATE TABLE t(a text);
> |postgres=# \d+ t
> | a | text | | | | extended | pglz | |
>
> assign_default_toast_compression() should set
> default_toast_compression_oid=InvalidOid, rather than
> default_toast_compression=NULL.

I will fix this.

> In my original patch, that was commented, since I was confused, not realizing
> that the GUC machinery itself assigns to the string value. We should assign to
> the cached Oid, instead.

> Reading my own patch, I see that in AccessMethodCallback() should also say
> InvalidOid.
> | default_toast_compression_oid = false;
> The false assignment was copied from namespace.c: baseSearchPathValid.

I will fix this.

So as of now, we can make this patch such that it is enough to work
with the built-in method and later we can add another enhancement
patch that can work with the custom compression methods.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-03-01 06:01:32 Re: repeated decoding of prepared transactions
Previous Message Justin Pryzby 2021-03-01 05:36:17 Re: [HACKERS] Custom compression methods