1、查看库空间下的表
show table status from mongodb_biddata;
SELECT
SUM(data_length+index_length)/1024/1024/1024 AS gb_total_data_size,
SUM(data_free)/1024/1024/1024 AS gb_total_free_space
FROM
information_schema.tables
WHERE
table_schema='库名';
2、方法二
SELECT
table_name AS '表名',
round(((data_length + index_length) / 1024 / 1024), 2) AS '总大小(MB)',
round((data_length / 1024 / 1024), 2) AS '数据大小(MB)',
round((index_length / 1024 / 1024), 2) AS '索引大小(MB)'
FROM
information_schema.tables
WHERE
table_schema = '库名'
ORDER BY
(data_length + index_length) DESC;
推荐方法二,清晰明了