通過一下命令我們可以獲取表的使用情況:
root@mysql 05:49:33>show table status like 'tbname'\G
結果:
*************************** 1. row ***************************Name: tbnameEngine: InnoDBVersion: 10Row_format: CompactRows: 3425Avg_row_length: 138Data_length: 475136 Max_data_length: 0Index_length: 1572864Data_free: 3145728Auto_increment: 6894011508Create_time: 2016-10-12 15:03:25Update_time: NULLCheck_time: NULLCollation: utf8mb4_general_ciChecksum: NULLCreate_options:Comment: NULL 1 row in set (0.00 sec)
Avg_row_length顧名思義是平均每行的長度,那么這個值是怎么獲得的?
1. 因為InnoDB的行數是一個近似值?
2. 平均每行長度=數據大小/行數?
3. 大部分都是超過了每行的長度,因為在InnoDB的老版本中為了頁對齊都自動的往上增加了,比如有一行行長29 bytes為了保證頁對齊,往上加了1或2個bytes。?
4. 在經歷了多次塊分裂后, 認為塊到達約69%的就滿了?
參考資料:
http://forums.mysql.com/read.php?22,219129,224296#msg-224296