分区的信息是记录在information_schema.partitions 这个表里的。它不能直接定位行所在的分区,但它可查到每个分区中有多少行。
例子:
select partition_name as part,partition_expression as expr,partition_description as descr,table_rows from information_schema.partitions
where table_schema= schema() and table_name=‘t‘
;
时间: 2024-10-04 10:17:41