Mysql Partition Introduction (iii)--LIST partition

Source: Internet
Author: User
The list differs from the range partition, and each partition must be explicitly defined, and each partition is defined according to the elements of the column values in a group of lists.

CREATE TABLE employees (    id INT NOT NULL,    fname VARCHAR(30),    lname VARCHAR(30),    hired DATE NOT NULL DEFAULT ‘1970-01-01‘,    separated DATE NOT NULL DEFAULT ‘9999-12-31‘,    job_code INT,    store_id INT)PARTITION BY LIST(store_id) (    PARTITION pNorth VALUES IN (3,5,6,9,17),    PARTITION pEast VALUES IN (1,2,10,11,19,20),    PARTITION pWest VALUES IN (4,12,13,14,18),    PARTITION pCentral VALUES IN (7,8,15,16));

If you want to delete all the data for a partition, you can use the ALTER Table employee table, TRUNCATE PARTITION pwest, and the efficiency is much higher than the delete <br/>

If you write multiple data at once, in InnoDB, this is considered a single transaction, if there is a non-conforming value, it will not be successful, in Mysiam, because there is no transaction processing, the qualifying value will be written, non-compliant will be discarded.

Welcome to visit my blog

Mysql Partition Introduction (iii)--LIST partition

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.