public inbox for [email protected]  
help / color / mirror / Atom feed
From: Matthias van de Meent <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Peter Geoghegan <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: David Christensen <[email protected]>
Subject: Re: btree: implement dynamic prefix truncation (was: Improving btree performance through specializing by key shape, take 2)
Date: Wed, 1 Nov 2023 11:32:46 +0100
Message-ID: <CAEze2Whp+6mUPdkV7s3oP9A1AwtKLPUTY5+gpykUqr+p82r0kg@mail.gmail.com> (raw)
In-Reply-To: <CAFj8pRD-WPgDy0o6CYwbAqQLsU=Z2OKOK5u48LrfCVx2rH5D+A@mail.gmail.com>
References: <CAEze2Wh-h20DmPSMXp4qHR0-ykh9=Z3ejX8MSsbikbOqaYe_OQ@mail.gmail.com>
	<CAFj8pRD-WPgDy0o6CYwbAqQLsU=Z2OKOK5u48LrfCVx2rH5D+A@mail.gmail.com>

On Wed, 1 Nov 2023 at 07:47, Pavel Stehule <[email protected]> wrote:
>
> Hi
>
> Ășt 31. 10. 2023 v 22:12 odesĂ­latel Matthias van de Meent <[email protected]> napsal:
>> This patch was originally suggested at [0], but it was mentioned that
>> they could be pulled out into it's own thread. Earlier, the
>> performance gains were not clearly there for just this patch, but
>> after further benchmarking this patch stands on its own for
>> performance: it sees no obvious degradation of performance, while
>> gaining 0-5% across various normal indexes on the cc-complete sample
>> dataset, with the current worst-case index shape getting a 60%+
>> improved performance on INSERTs in the tests at [0].
>
>
> +1

Thanks for showing interest.

> This can be nice functionality. I had a customer with a very slow index scan - the main problem was a long common prefix like prg010203xxxx.

I'll have to note that this patch doesn't cover cases where e.g. text
attributes have large shared prefixes, but are still unique: the
dynamic prefix compression in this patch is only implemented at the
tuple attribute level; it doesn't implement type aware dynamic prefix
compression inside the attributes. So, a unique index on a column of
int32 formatted like '%0100i' would not materially benefit from this
patch.

While would certainly be possible to add some type-level prefix
truncation in the framework of this patch, adding that would require
significant code churn in btree compare operators, because we'd need
an additional return argument to contain a numerical "shared prefix",
and that is not something I was planning to implement in this patch.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)






view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: btree: implement dynamic prefix truncation (was: Improving btree performance through specializing by key shape, take 2)
  In-Reply-To: <CAEze2Whp+6mUPdkV7s3oP9A1AwtKLPUTY5+gpykUqr+p82r0kg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox