Get the App
SLTechnology News&Howtos  ›  Database  › 

A brief introduction to LIST Partition of Mysql Partition

Shulou Source: shulou.com Published: 2022-06-01 19:31:22 09月27日 Update

The following mainly brings you a brief introduction to the LIST partition of the Mysql partition. I hope these contents can bring you practical use, which is also the main purpose of this article when I edit the LIST partition of the Mysql partition. All right, don't talk too much nonsense, let's just read the following.

LIST is different from RANGE partitions in that each partition must be explicitly defined based on the elements of the members of the column values in a set of lists

CREATE TABLE employees (id INT NOT NULL, fname VARCHAR (30), lname VARCHAR (30), hired DATE NOT NULL DEFAULT '1970-01-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 data in a partition, you can use the ALTER TABLE employee table, TRUNCATE PARTITION pWest, and is much more efficient than DELETE

If multiple pieces of data are written at one time, in INNODB, this will be regarded as a single transaction. If there is a value that does not match, it will not be written successfully. In MYSIAM, because there is no transaction, eligible values will be written, and those that do not match will be discarded.

Do you find it very helpful to give a brief introduction to the LIST partition of Mysql partition above? If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

Tags: Content following transaction data success one-time element single can be passed employee multiple actual nonsense member efficiency more condition usefulness purpose article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Huawei Shulou Technology Microsoft