我有一个表的行计数为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