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

What are the points for attention in the use of MySQL subpartition

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

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!

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

Development

Wechat

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

12
Report