Hi, Marko
Thanks a lot for so much detail.
Gu Lei
-----原始邮件-----
发件人: mark...@oracle.com [mailto:mark...@oracle.com]
发送时间: 2007年10月9日 14:16
收件人: Gu Lei(Tech)
抄送: inte...@lists.mysql.com
主题: Re: Does THE INDEX PAGE In page0page.c mean secondary index
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,
Marko Mäkelä
Innobase Oy/Oracle Corp.