13. mysql Partition RANGE && LIST

Source: Internet
Author: User

1. The RANGE partition creates an instance:CREATE TABLEEMP (IDint  not NULL Primary Keyauto_increment, nameChar( -) not NULL default "') PARTITION byRANGE (ID) (the field ID is defined as the field of the partition PARTITION P0VALUESLess THAN ( -), the IDs below 99 are grouped into the P0 partition PARTITION P1VALUESLess THAN ( $), --199PARTITION P2VALUESLess THAN ( -) $-299    ); PS: Because the default will also count 0, so P0 can actually store 0-99 or-PS:: either does not include the primary key, if you want to include the primary key, then the partition field must also be the primary key ps::mysql5.5 above the support date partition, what role,^_^, you can think of2. The list partition creates an instance:CREATE TABLElist_emp (Tidint  not NULL PRIMARY Keyauto_increment, TnameChar( -)) PARTITION byLIST (TID) (PARTITION P0VALUES inch(1,3,5,7,9), PARTITION P1VALUES inch(2,4,6,8,Ten)    );    PS:: Through the above 2 kinds of partitions is not difficult to see, the range partition is to specify a range, and the list partition is a specified list, in the list, only the specified value can be saved in! PS:: Personally feel that the list partition can be used more in the classification test:Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); Insert  intoList_empValues(NULL,'Php'); ERROR1526(HY000):TableHas no partition forValue OnePS:: 11th data when the error, because no partition table contains it

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.