1503-a PRIMARY KEY must include all columns in the table ' s partitioning function

Source: Internet
Author: User
1503-a PRIMARY KEY must include all columns in the table ' s partitioning function cause of error: The primary key field of the table must contain a partition field. Why? for example, the ID is auto_increment primary key, which is partitioned by date. Consider the following scenario, inserting a record with an ID of 100, MySQL is aware of the insertion into that partition based on the date, but it is obviously inefficient to check that all partitions already contain records with ID 100. If you do not check all the partitions, only check the currently inserted partition, causing a problem, partition 1 already has an ID of 100, and the partition table external rendering is a logical table, then this table has two ID 100 records, obviously violate the definition of the primary key. The primary key field contains the partition field, and without this problem, the record with ID 100 in two partitions is not the same as the time.

1503-a PRIMARY KEY must include all columns in the table ' s partitioning function

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.