Partitions In MYSQL5.5 tables

Source: Internet
Author: User

MYSQL5.5 table partition problem 1. the attribute of the field is timestamp, and an exception Constant, random or timezone-dependent expressions in (sub) occurs during partitioning) partitioning function are not allowed found on the Internet. for example, if a partition of the timestamp type does not work, change it to DATETIME or DATE pruning is not expected to work for tables partitioned on a TIMESTAMP column, and you shoshould use a DATETIME or DATE column for this instead. 2. after changing to datetime, the following error occurs: a primary key must include all columns in the table's partitioning function mysql partition field must be included in the primary key. the SQL statement is as follows:

Alter table Test partition by list (dayofweek (time) (PARTITION p01 values in (1), PARTITION p02 values in (2), PARTITION p03 values in (3 ), PARTITION p04 values in (4), PARTITION p05 values in (5), PARTITION p06 values in (6), PARTITION p07 values in (7 ), PARTITION perr values in (0 ));

 

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.