查看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='spider_2020' and table_name = 'spider_72_ggzy_zrzyb_content';

其中是spider_2020数据库,spider_72_ggzy_zrzyb_content是数据表名称

 

mysql压缩数据表命令

alter table spider_72_ggzy_zrzyb_content KEY_BLOCK_SIZE=8;

alter table spider_72_ggzy_zrzyb_content row_format=COMPRESSED;

其中 spider_72_ggzy_zrzyb_content 是数据表名称,压缩率在60%左右,10G文件,压缩后还剩6G

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM