Re: [HACKERS] Custom compression methods

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(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-02-27 16:05:12
Message-ID: 20210227160512.GX20769@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 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.

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.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message AJG 2021-02-27 17:40:58 Re: Improving connection scalability: GetSnapshotData()
Previous Message Peter Eisentraut 2021-02-27 15:19:30 Re: psql - add SHOW_ALL_RESULTS option