365平台-beat365下载地址-BET体育365投注官网

BET体育365投注官网

MySQL查看表占用空间大小

MySQL查看表占用空间大小

-----------------------------------------------------------------------------------

1.查看所有数据库容量大小

select

table_schema as '数据库',

sum(table_rows) as '记录数',

sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',

sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'

from information_schema.tables

group by table_schema

order by sum(data_length) desc, sum(index_length) desc;

2.查看所有数据库各表容量大小

select

table_schema as '数据库',

table_name as '表名',

table_rows as '记录数',

truncate(data_length/1024/1024, 2) as '数据容量(MB)',

truncate(index_length/1024/1024, 2) as '索引容量(MB)'

from information_schema.tables

order by data_length desc, index_length desc;

3.查看指定数据库容量大小

例:查看mysql库容量大小

select

table_schema as '数据库',

sum(table_rows) as '记录数',

sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',

sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'

from information_schema.tables

where table_schema='mysql';

4.查看指定数据库各表容量大小

例:查看mysql库各表容量大小

select

table_schema as '数据库',

table_name as '表名',

table_rows as '记录数',

truncate(data_length/1024/1024, 2) as '数据容量(MB)',

truncate(index_length/1024/1024, 2) as '索引容量(MB)'

from information_schema.tables

where table_schema='mysql'

order by data_length desc, index_length desc;

-----------------------------------------------------------------------------------

select concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MBfrom tables where table_schema='passport' and table_name='tb_user_info';-- 569.98MB 141.98MB

select concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MBfrom tables where table_schema='passport_v2' and table_name='tb_user_info';

-- 2128.94MB 285.00MB

← 一些女性喜欢嫁给「黑人」,其中4点原因很现实,让人感叹_手机网易网 微信怎么关联手机号 →

相关阅读

吃扇贝肉不要囫囵吞枣,这些部位不能吃!

扇贝,真的是大自然的美味馈赠!扇贝肉占扇贝的比重非常大,而且扇贝也很容易料理,深受无数吃货的喜爱。不过,爱吃扇贝肉的你,知不知

📅 11-08 🌿 BET体育365投注官网

在 iPhone 上打开或关闭 Siri 建议

在 iPhone 上打开或关闭 Siri 建议打开“Siri 建议”后,你甚至可以在询问前在部分 App 中获取建议操作。例如,在“邮件”中收到邀请时,系统会

📅 09-22 🌿 BET体育365投注官网

“宁创贷”是指什么?

问:“宁创贷”是指什么? 答:“宁创贷”是南京市的特色化普惠金融政策体系,包括“小微担”“宁科贷”“专精特新保”“金陵惠农贷”等

📅 11-04 🌿 BET体育365投注官网