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