Re: Compressed TOAST Slicing - Mailing list pgsql-hackers

From Paul Ramsey
Subject Re: Compressed TOAST Slicing
Date
Msg-id 9136FFD1-EE77-4D90-9856-AFFDF117BCB8@cleverelephant.ca
Whole thread Raw
In response to Re: Compressed TOAST Slicing  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Compressed TOAST Slicing
Re: Compressed TOAST Slicing
List pgsql-hackers
> On Apr 9, 2019, at 10:09 AM, Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>
> He advised me to use algorithm that splits copied regions into smaller non-overlapping subregions with exponentially
increasingsize. 
>
> while (off <= len)
> {
>    memcpy(dp, dp - off, off);
>    len -= off;
>    dp += off;
>    off *= 2;
> }
> memcpy(dp, dp - off, len);
>
> On original Paul's test without patch of this thread this optimization gave about x2.5 speedup.
> I've composed more detailed tests[0] and tested against current master. Now it only gives 20%-25% of decompression
speedup,but I think it is still useful. 

Wow, well beyond slicing, just being able to decompress 25% faster is a win for pretty much any TOAST use case. I guess
the$100 question is: portability? The whole reason for the old-skool code that’s there now was concerns about
memcpy’ingoverlapping addresses and Bad Things happening. 

P.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Copy function for logical replication slots
Next
From: Andrey Borodin
Date:
Subject: Re: Compressed TOAST Slicing