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