Relationship and restrictions between MySQL partition and key

Source: Internet
Author: User
Tags mysql manual

MySQL has introduced the partition function since 5.1, which is indeed a very good feature and can help solve many problems. During partition creation, note that all columns involved in partition must appear in all unique indexes.

For example, a table has two indexes: Unique index1 (col1, col2) and unique index2 (col1). When partition is created, by range (col1) is created successfully. However, by range (col2 ), creation fails. Because both indexes contain col1, but only one index contains col2.

The table's primary key is also a unique key and must meet the preceding constraints.

Note that if the table structure does not contain any unique key, partitions can be created on any column.

 

For more details, see the MySQL Manual: http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html

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.