On Tue, Oct 09, 2007 at 09:55:54AM +0800, Gu Lei(Tech) wrote:
Hello everyone
In page0page.c there is description about THE INDEX PAGE.
Does THE INDEX PAGE mean secondary index or cluster index ?
It means any B-tree node in InnoDB. That includes secondary indexes,
clustered indexes, and the insert buffer B-tree.
As far as page0page.c is concerned, there is no difference between
clustered index records and secondary index records. The format of
clustered index records on a B-tree leaf page is as follows:
<primary key columns>, DB_TRX_ID, DB_ROLL_PTR, <other columns>
The format of secondary index records on a B-tree leaf page is as follows:
<secondary key columns>, <primary key columns>
On a non-leaf page of the index B-tree, the format is like this:
<primary key columns>, <node ptr>
or
<secondary key columns>, <node ptr>
where <node ptr> is a 32-bit integer that points to a B-tree page one
level deeper (that is, another non-leaf page, or a leaf page).
When there is no primary key, InnoDB generates a 6-byte sequence number,
DB_ROW_ID. When the primary key includes column prefixes, the full
columns are included in <other columns>.
You're welcome,