Re: [HACKERS] Custom compression methods - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: [HACKERS] Custom compression methods
Date
Msg-id 53e9be10-d5fb-77a4-fd00-2ec6d12c2b8b@enterprisedb.com
Whole thread Raw
In response to Re: [HACKERS] Custom compression methods  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 3/20/21 4:21 PM, Justin Pryzby wrote:
> 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
> 

Thanks. I've pushed a patch tweaked per your feedback.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Using COPY FREEZE in pgbench
Next
From: Thomas Munro
Date:
Subject: Re: proposal - psql - use pager for \watch command