Clustered index of the MySQL InnoDB storage engine

Source: Internet
Author: User
InnoDB Clustered Index

MySQL has no support for clustered indexes, depending on which storage engine is used.

MySQL InnoDB is bound to build a clustered index, so-called aggregation, refers to the actual data rows and related key values are saved in a piece, which also determines that a table can only have a clustered index , that is, MySQL does not save the data row in two places at a time. InnoDB are usually clustered according to the primary key value (primary key), but what happens when a table has no PK? InnoDB the order in which the clustered index reference columns are selected is:

1. If the primary key (primary key) is declared, the column will be made a clustered index
2. If no primary key is declared, a unique and non-empty index column is used as the primary key, which becomes the clustered index of this table
3. The above two conditions are not satisfied, InnoDB will generate a virtual clustered index on its own.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.