查看分区信息

查看Mysql里都有哪些数据库里面有什么分区表

1
2
3
4
5
6
SELECT
TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_COMMENT
FROM
INFORMATION_SCHEMA.PARTITIONS
WHERE
PARTITION_NAME IS NOT NULL;

查看某个分区表都有哪些分区及使用情况

1
2
3
4
5
6
7
8
9
10
11
USE LOCKLOG;
SELECT
partition_name part,
partition_expression expr,
partition_description descr,
table_rows
FROM
INFORMATION_SCHEMA.partitions
WHERE
TABLE_SCHEMA = schema()
AND TABLE_NAME = 'lock_log';

查看分区表lock_log的创建sql及分区类型

1
SHOW CREATE TABLE lock_log \G;

坚持原创分享,您的支持将鼓励我继续创作