Skip to content

MySQL 确认各个表占用的存储大小 #26

@binderclip

Description

@binderclip

主要是使用 information_schema.tables 中的统计数据,可以查看数据、索引部分分别的占用。

select table_schema,table_name,round((data_length+index_length)/1024/1024/1024,2) 'used_GB',round((data_length)/1024/1024/1024,2) 'data_GB',round((index_length)/1024/1024/1024,2) 'index_GB',round((data_free)/1024/1024/1024,2) 'free_GB' from information_schema.tables limit 10000 order by used_GB desc;

How to Get the Size of a Table in MySQL | Tutorial by Chartio

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions