b-tree index search algorithms

From: Samuel Vogel <s(at)muel-vogel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: b-tree index search algorithms
Date: 2012-07-16 23:51:08
Message-ID: 5004A8EC.1000307@muel-vogel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I'm currently on a university research project if performance could be
increased by substituting different inter-node search algorithms instead
of the currently used binary search.

But I'm having troubles understanding how the general b-tree
implementation (nbtree.h) is used to represent for example a simple
primary key on an integer column. I've debug printed the
'scankey->sk_argument' and all attributes of the index tuples on the
pages being traversed (simply ran 'DatumGetInt32' on both) but I never
see one of the integers actually appearing in my table being logged when
I do a select.

This is why I assume that all column values are hashed before they are
pushed into the b-tree, but this hashing would have to preserve the
order of the keys. I have tried to look at stack traces, but the b-tree
implementations seems to be used commonly for many things that it's hard
to find the interesting bits for me.

I would like to know how the b-tree and column indexes interact. The
readmes for the b-tree seem really implementation centric and I'm not
getting a hold the whole picture.

Regards,
Samuel Vogel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2012-07-17 00:29:26 Re: Using pg_upgrade on log-shipping standby servers
Previous Message Tom Lane 2012-07-16 23:17:35 Re: CompactCheckpointerRequestQueue versus pad bytes