Re: A doubt.. - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: A doubt..
Date
Msg-id dtjhqb$2itf$1@news.hub.org
Whole thread Raw
In response to A doubt..  (Dhanaraj <Dhanaraj.M@Sun.COM>)
List pgsql-hackers
"Dhanaraj" <Dhanaraj.M@Sun.COM> 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  | RTGETTUPLEBTREE  | BTGETTUPLEHASH   | HASHGETTUPLEGIST   | 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





pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: PostgreSQL unit tests
Next
From: "Pavel Stehule"
Date:
Subject: Re: Request: set opclass for generated unique and primary key indexes