Re: Improving btree performance through specializing by key shape, take 2

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, David Christensen <david(at)pgguru(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improving btree performance through specializing by key shape, take 2
Date: 2023-08-30 19:50:28
Message-ID: CAEze2WgK90MqAxR0CBvLarS_my0wBEYQ5yMHCrcNaPLF6zZC_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 27 Jun 2023 at 06:57, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> At high level 0001 looks fine to me, just some suggestions

Thanks for the review.

> 1.
> +Notes about dynamic prefix truncation
> +-------------------------------------
>
> I feel instead of calling it "dynamic prefix truncation" should we can
> call it "dynamic prefix skipping", I mean we are not
> really truncating anything right, we are just skipping those
> attributes in comparison?

The reason I am using "prefix truncation" is that that is a fairly
well-known term in literature (together with "prefix compression"),
and it was introduced on this list with that name by Peter in 2018
[0]. I've seen no good reason to change terminology; especially
considering that normal "static" prefix truncation/compression is also
somewhere on my to-do list.

> 2.
> I think we should add some comments in the _bt_binsrch() function
> where we are having main logic around maintaining highcmpcol and
> lowcmpcol.
> I think the notes section explains that very clearly but adding some
> comments here would be good and then reference to that section in the
> README.

Updated in the attached version 12 of the patchset (which is also
rebased on HEAD @ 9c13b681). No changes apart from rebase fixes and
these added comments.

Kind regards,

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

[0] https://www.postgresql.org/message-id/CAH2-Wzn_NAyK4pR0HRWO0StwHmxjP5qyu+X8vppt030XpqrO6w@mail.gmail.com

Attachment Content-Type Size
v12-0003-Use-specialized-attribute-iterators-in-the-speci.patch application/octet-stream 11.9 KB
v12-0005-Add-an-attcacheoff-populating-function.patch application/octet-stream 4.7 KB
v12-0004-Optimize-nbts_attiter-for-nkeyatts-1-btrees.patch application/octet-stream 5.5 KB
v12-0002-Specialize-nbtree-functions-on-btree-key-shape.patch application/octet-stream 253.6 KB
v12-0001-Implement-dynamic-prefix-compression-in-nbtree.patch application/octet-stream 25.5 KB
v12-0006-btree-specialization-for-variable-length-multi-a.patch application/octet-stream 11.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2023-08-30 20:55:24 Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans
Previous Message Jim Jones 2023-08-30 19:08:33 Re: Allow specifying a dbname in pg_basebackup connection string