Subject: how are key values stored in a B-tree index files?

From: Pei Cao <[email-masked]>
Date: Wed, 31 Aug 1994 23:56:08 -0400

Hi, I am trying to figure out how the B-tree index file works.  I have a
relation with a non-clustered unique integer key, and I built a B-tree index
on it.  I'd like to figure out from the index files what disk pages/blocks 
have tuples whose key values are between, say, 500 and 600.  

So I used "pagedoc -b -d2 index" to dump the index file contents.
The problem is, it seems that each IndexTupleData only has the tid of the 
corresponding heap tuple, but no key value of this heap tuple.  So how does a 
search for a tuple with a particular key work?  

I don't even see the key values on internal pages, so how does a search know
which direction to go down the b-tree?

Thanks a lot!

Pei Cao
Grad. Student, CS Dept.
Princeton University

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================