Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What should be paid attention to when using MySQL subpartition

Shulou Source: shulou.com Published: 2022-05-31 10:54:40 10月03日 Update

The editor of this article introduces in detail "what you should pay attention to in the use of MySQL sub-partition". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "what should you pay attention to in the use of MySQL sub-partition" can help you solve your doubts. Let's follow the editor's train of thought to learn new knowledge.

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)) After reading this, the article "what to pay attention to in the use of MySQL subzones" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Articles content appropriateness same Yizi multiple examples ideas data quantity New knowledge more steps knowledge knowledge points disk articles Index details Industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Docker Microsoft macOS Huawei