Mysql分区操作
分区信息查询
select
partition_name part,
partition_expression expr,
partition_description descr,
table_rows
from information_schema.partitions where
table_schema = schema()
and table_name='pcg_cdn_basedata' ORDER BY part desc
指定分区查询
select * from table partition(fenquname);
增加分区
ALTER TABLE t_cdn_obs_domain_usage_detail ADD PARTITION (
PARTITION p20211201
VALUES
LESS THAN ( 20211202 )
)
删除分区
ALTER TABLE t_cdn_obs_domain_usage_detail DROP PARTITION p20221218;