What are the points for attention in the use of MySQL subpartition
Editor to share with you what are the points for attention in the use of MySQL sub-partition, I believe most people do not know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.
1. Each partition must have the same number of subpartitions.
2. If you use SUBPARTITION on a partition on a partition table to explicitly define subpartitions, then you must define subpartitions for all other partitions.
Subpartitions can be used for very large tables, allocating data and indexes across multiple disks.
Example
CREATE TABLE ts (id INT, purchased DATE) PARTITION BY RANGE (YEAR (purchased)) SUBPARTITION BY HASH (TO_DAYS (purchased)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0a DATA DIRECTORY ='/ disk0' INDEX DIRECTORY ='/ disk1') SUBPARTITION s0b DATA DIRECTORY ='/ disk2' INDEX DIRECTORY ='/ disk3'), PARTITION p1 VALUES LESS THAN (2000) (SUBPARTITION S1a DATA DIRECTORY ='/ disk4/data' INDEX DIRECTORY ='/ disk4/idx' SUBPARTITION s1b DATA DIRECTORY ='/ disk5/data' INDEX DIRECTORY ='/ disk5/idx'), PARTITION p2 VALUES LESS THAN MAXVALUE (SUBPARTITION S2a, SUBPARTITION S2b)) The above is all the contents of this article entitled "what are the points for attention in the use of MySQL subzones?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!