我有一個表的行計數爲48769914
。問題是查詢數據庫時的虛假信息,即data_length。任何想法如何糾正這種不端行爲?MySQL顯示狀態
mysql> show table status like "events"\G
*************************** 1. row ***************************
Name: events
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 0
Avg_row_length: 0
Data_length: 16384
Max_data_length: 0
Index_length: 32768
Data_free: 7405043712
Auto_increment: 59816602
Create_time: 2012-06-05 05:12:37
Update_time: NULL
Check_time: NULL
Collation: utf8_general_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.88 sec)
精確計數:
mysql> select count(id) from events;
+-----------+
| count(id) |
+-----------+
| 48769914 |
+-----------+
1 row in set (5 min 37.67 sec)
更新狀態信息看起來像表是空的。零行,零行長度和表中基本沒有數據。我怎樣才能讓MySQL顯示正確的數據估計。
正是u需要什麼看InnoDB restrictions手冊中? –
我想知道爲什麼'show status'返回無用的信息,或者說如何獲得有用的數據 – cpower