Re: Compressed TOAST Slicing

From: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Regina Obe <r(at)pcorp(dot)us>
Subject: Re: Compressed TOAST Slicing
Date: 2019-03-13 18:42:33
Message-ID: 9151C9FD-98E0-4462-81CE-E5C3365A1454@cleverelephant.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Mar 13, 2019, at 9:32 AM, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
>
>
>> 13 марта 2019 г., в 21:05, Paul Ramsey <pramsey(at)cleverelephant(dot)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 Content-Type Size
compressed-datum-slicing-20190313b.patch application/octet-stream 6.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mithun Cy 2019-03-13 18:45:57 Re: pg_rewind : feature to rewind promoted standby is broken!
Previous Message Tom Lane 2019-03-13 18:36:13 Re: hyrax vs. RelationBuildPartitionDesc