"Dhanaraj" <[EMAIL PROTECTED]> wrote
> Hi all
>
> I looked at B-tree and r-tree implementations. However i could not find
> out where it is used.

The secret is in index_getnext(), which is a general cap for all index
access methods. First it retrieves the correct AM from the pg_am system
catalog:

test=# select amname, amgettuple from pg_am;
 AMNAME |  AMGETTUPLE
--------+--------------
 RTREE  | RTGETTUPLE
 BTREE  | BTGETTUPLE
 HASH   | HASHGETTUPLE
 GIST   | GISTGETTUPLE
(4 rows)

Thus, for btree, it will use btgettuple() for the operation ...

> It seems that the data retrieved from the data
> base is kept in the tuple data structure.
>
If you mean there is no conversion from disk format to memory format (vice
versa), then yes. Especially you may notice that the algined data items on
the data page are kept aligned in both memory and disk.

Regards,
Qingqing




---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to