Re: [HACKERS] Custom compression methods

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, 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>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [HACKERS] Custom compression methods
Date: 2021-03-20 15:21:46
Message-ID: 20210320152146.GS11765@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 20, 2021 at 04:13:47PM +0100, Tomas Vondra wrote:
> +++ b/src/backend/access/brin/brin_tuple.c
> @@ -213,10 +213,20 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
> (atttype->typstorage == TYPSTORAGE_EXTENDED ||
> atttype->typstorage == TYPSTORAGE_MAIN))
> {
> + Datum cvalue;
> + char compression = GetDefaultToastCompression();
> Form_pg_attribute att = TupleDescAttr(brdesc->bd_tupdesc,
> keyno);
> - Datum cvalue = toast_compress_datum(value,
> - att->attcompression);
> +
> + /*
> + * If the BRIN summary and indexed attribute use the same data
> + * type, we can the same compression method. Otherwise we have

can *use ?

> + * to use the default method.
> + */
> + if (att->atttypid == atttype->type_id)
> + compression = att->attcompression;

It would be more obvious to me if this said here:
| else: compression = GetDefaultToastCompression

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-03-20 15:23:19 Re: pg_upgrade failing for 200+ million Large Objects
Previous Message Andrew Dunstan 2021-03-20 15:17:41 Re: pg_upgrade failing for 200+ million Large Objects