1. 程式人生 > 實用技巧 >mysql中count(*)和information_schema.tables中值不相同

mysql中count(*)和information_schema.tables中值不相同

問題

在檢視mysql表中,發現從information_schema.tables中TABLE_ROWS獲取的表的行值,與實際select count(*) from xxx的結果值是不一樣的

官網中,解釋如下:

rows_description

結論

針對 MyISAM引擎的表,行數是確定的值
針對其他引擎的表,行數只是一個大概值

不過INFORMATION_SCHEMA庫下的表為NULL