Re: Compressed TOAST Slicing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Compressed TOAST Slicing
Date
Msg-id 22617.1554831022@sss.pgh.pa.us
Whole thread Raw
In response to Re: Compressed TOAST Slicing  (Andres Freund <andres@anarazel.de>)
Responses Re: Compressed TOAST Slicing
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-04-09 10:12:56 -0700, Paul Ramsey wrote:
>> Wow, well beyond slicing, just being able to decompress 25% faster is a win for pretty much any TOAST use case. I
guessthe $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. 

> Just use memmove? It's usually as fast these days.

If I recall what this is trying to do, memmove will give the wrong
result.  We want the expansion to replicate the same data multiple
times, which in normal use of memcpy/memmove would be thought to be
the Wrong Thing.

The proposal is kind of cute, but I'll bet it's a net loss for
small copy lengths --- likely we'd want some cutoff below which
we do it with the dumb byte-at-a-time loop.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: Compressed TOAST Slicing
Next
From: Robbie Harwood
Date:
Subject: Re: [PATCH v20] GSSAPI encryption support