Get the App
SLTechnology News&Howtos  ›  Database  › 

Navicat for MySQL performs table partitioning operation (illustration)

Shulou Source: shulou.com Published: 2022-06-01 12:28:26 11月14日 Update

1. table creation

To create a table partition, the partition condition (of timestamp type) must be set to a primary key (required), or the entire table must have no primary key (can be added after partitioning is complete)

or

2. Switch to partition operation interface

3. partition operation

Set general partition conditions

Set partitions that do not satisfy p01 and p02 conditions (similar to the last else in if else if else)

4. Click OK and save at last.

5. look partition

When you open it again, you can see that the conditions of p01 and p02 have become integers (actually timestamps).

6. new

If there is a partition with "LESS THAN MAXVALUE", delete this partition first, and then add a new partition. Note: Deleting a partition will delete the data to which this partition belongs.

View the amount of data in a partition:

select partition_name,partition_description, from_unixtime(partition_description,'%Y-%m-%d') expirydate,table_rowsfrom information_schema.` partitions` where table_name = 't_test';

The above operations can also be done using SQL, you can directly click mysql table partition (according to time) to view

Tags: Condition data time normal again ownership integer interface type switch Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker Shulou Technology MySQL Xiaomi