The partition in MySQL has range, list, hash, key four kinds of partitioning methods
We introduce the Range method here, and others can digest
Partitioning an existing table (range mode)
ALTER table name PARTITION by range (field name) (PARTITION partition name values less THAN (field value));
Alter TABLE by Range (ID) ( values less than (+), values less than (20 ), VALUES less than (MAXVALUE));
View partition status
SELECT * from User_log
Query development Zoning
SELECT * from user_log PARTITION (user_log_a); SELECT * from user_log PARTITION (user_log_b); Select * from User_log PARTITION (User_log_c);
Other Operations Commands
Merging Alter Table into values less than (XX)); Delete partition ALTER TABLE Table name drop partition partition name (lost data) Delete partition (do not drop data)Altertable news_main Remove partitioning;
MySQL partition those things