MySQL Forums
Forum List  »  General

Re: Primary key - link to data ?
Posted by: Rick James
Date: March 24, 2010 11:10PM

In MySQL's MyISAM, no. The data is simply a file; the indexes (including PK) point into the data file. All indexes are BTree organized.

In MySQL's InnoDB, the PRIMARY KEY and the data are 'clustered' together, and organized in a BTree. That is, when you find a a particular PK (via drilling down the BTree), you are sitting at the one row that it belongs to. Secondary keys have the PK implicitly included; this is how they get to the data record. Again, all indexes are BTree.

In MySQL's MEMORY table engine, a Hash is used.

A PRIMARY KEY is necessarily UNIQUE.

Options: ReplyQuote


Subject
Written By
Posted
March 24, 2010 06:14PM
Re: Primary key - link to data ?
March 24, 2010 11:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.