Re: Compressed TOAST Slicing - Mailing list pgsql-hackers

From Paul Ramsey
Subject Re: Compressed TOAST Slicing
Date
Msg-id 9151C9FD-98E0-4462-81CE-E5C3365A1454@cleverelephant.ca
Whole thread Raw
In response to Re: Compressed TOAST Slicing  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-hackers
> On Mar 13, 2019, at 9:32 AM, Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>
>
>
>> 13 марта 2019 г., в 21:05, Paul Ramsey <pramsey@cleverelephant.ca> написал(а):
>>
>> Here is a new (final?) patch ...
>>
>> <compressed-datum-slicing-20190313a.patch>
>
> This check
>
> @@ -744,6 +748,8 @@ pglz_decompress(const char *source, int32 slen, char *dest,
>                 {
>                     *dp = dp[-off];
>                     dp++;
> +                    if (dp >= destend)    /* check for buffer overrun */
> +                        break;        /* do not clobber memory */
>                 }
>
> is still done for every byte. You can precompute maximum allowed length before that cycle. Here's diff

Thanks! Attached change,

P
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Next
From: Robert Haas
Date:
Subject: Re: hyrax vs. RelationBuildPartitionDesc