Create an Account
username: password:
 
  MemeStreams Logo

MySQL AB :: MySQL 5.0 Reference Manual :: 14.2.13 InnoDB Table and Index Structures

search

Lost
Picture of Lost
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Lost's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
MySQL AB :: MySQL 5.0 Reference Manual :: 14.2.13 InnoDB Table and Index Structures
Topic: Technology 9:34 pm EST, Mar 10, 2007

Every InnoDB table has a special index called the clustered index where the data for the rows is stored. If you define a PRIMARY KEY on your table, the index of the primary key is the clustered index.

If you do not define a PRIMARY KEY for your table, MySQL picks the first UNIQUE index that has only NOT NULL columns as the primary key and InnoDB uses it as the clustered index. If there is no such index in the table, InnoDB internally generates a clustered index where the rows are ordered by the row ID that InnoDB assigns to the rows in such a table. The row ID is a 6-byte field that increases monotonically as new rows are inserted. Thus, the rows ordered by the row ID are physically in insertion order.

Accessing a row through the clustered index is fast because the row data is on the same page where the index search leads. If a table is large, the clustered index architecture often saves a disk I/O when compared to the traditional solution. (In many database systems, data storage uses a different page from the index record.)

Clustered indexes means that InnoDB will append the primary key to each one of your indexes on an InnoDB table. Good to know.

MySQL AB :: MySQL 5.0 Reference Manual :: 14.2.13 InnoDB Table and Index Structures



 
 
Powered By Industrial Memetics
RSS2.0