查看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