b-tree index search algorithms - Mailing list pgsql-hackers

From Samuel Vogel
Subject b-tree index search algorithms
Date
Msg-id 5004A8EC.1000307@muel-vogel.de
Whole thread Raw
Responses Re: b-tree index search algorithms
List 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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CompactCheckpointerRequestQueue versus pad bytes
Next
From: Jeff Davis
Date:
Subject: Re: Using pg_upgrade on log-shipping standby servers