Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the meaning of range partition in mysql

Shulou Source: shulou.com Published: 2022-06-03 09:55:31 11月01日 Update

This article mainly shows you "what is the meaning of range partition in mysql", the content is simple and clear, hoping to help you solve your doubts, let the editor lead you to study and learn "what is the meaning of range partition in mysql" this article.

The main contents are as follows: 1. Based on the given interval boundary, several continuous interval ranges are obtained, and the data is allocated to different partitions according to the landing point of the partition key.

Range partitions are mainly used for partitions of date columns.

2. Range partitioning is realized by using PARTITION BY RANGE (expr).

Where expr can be a column value, or an expression based on a column value and returning an integer value, such as YEAR (date).

Example

CREATE TABLE `Order` (`id` INT NOT NULL AUTO_INCREMENT, `partition_ Key` INT NOT NULL, `amt` DECIMAL (5) NULL) PARTITION BY RANGE (partition_key) PARTITIONS 5 (PARTITION part0 VALUES LESS THAN (201901), PARTITION part1 VALUES LESS THAN (201902), PARTITION part2 VALUES LESS THAN (201903), PARTITION part3 VALUES LESS THAN (201904), PARTITION part4 VALUES LESS THAN (201905), PARTITION part4 VALUES LESS THAN MAXVALUE INSERT INTO `Order` (`id`, `partition_ key`, `amt`) VALUES ('1partition_,' 201901partition, '1000'); INSERT INTO `Order` (`id`, `Order`, `amt`) VALUES (' 2Order`, '201902regions,' 800'); INSERT INTO `Order` (`id`, `Order`, `amt`) VALUES ('3neighbors,' 201903zones, '1200'); above is all the content of this article entitled "what is the meaning of range partition in mysql"? 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!

Tags: Meaning content article interval learning help difference example numerical value data date easy to understand more organization knowledge ribbon scope landing point industry expression Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Docker vpn Microsoft