Re: memory layouts for binary search in nbtree

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: memory layouts for binary search in nbtree
Date: 2016-05-20 02:38:02
Message-ID: CAM3SWZQdEaEsZ62NopHB0uuw=kAqQ8MMeCTCDYSAt8=oVGyy9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 18, 2016 at 6:25 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> currently we IIRC use linearly sorted datums for the search in
> individual btree nodes. Not surprisingly that's often one of the
> dominant entries in profiles. We could probably improve upon that by
> using an order more optimized for efficient binary search.

Did you ever try running a pgbench SELECT benchmark, having modified
things such that all PKs are on columns that are not of type
int4/int8, but rather are of type numeric? It's an interesting
experiment, that I've been meaning to re-run on a big box.

Obviously this will be slower than an equivalent plain pgbench SELECT,
but the difference may be smaller than you expect.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hao Lee 2016-05-20 07:13:03 It's seems that the function "do_text_output_multiline" does not suit for format "line1\nline2\n...lineN".
Previous Message Peter Geoghegan 2016-05-20 02:28:31 Re: memory layouts for binary search in nbtree