Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A brief introduction to LIST Partition of Mysql Partition

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report