title: Why does information_schema.tables give such an unstable answer for number of rows?
body: <p>I run into a strange problem using MySQL 5.5. I wanted to gather statistics about table size. So, I made up the following query:</p>
  
  <pre><code>SELECT table_name AS name, data_length, index_length, table_rows, avg_row_length
  FROM information_schema.TABLES 
  WHERE table_schema = "&lt;MySchema&gt;"
   AND table_name in (&lt;Table names I'm interested in&gt;)
  order by table_name;
  </code></pre>
  
  <p>However, I noticed something strange, when I ran this query several times in a few seconds. The data_length and index_length remain actually the same in all queries (or change a little bit, since there were some writes during my script execution made by customers).</p>
  
  <p>However, table_rows gives every time a pretty different answer. For example, the first query gives for a table A about a 10000 rows, the second query says it's about 20000 rows, and so on. However, when I run the query like this:</p>
  
  <pre><code>select count(*) from TableA;
  </code></pre>
  
  <p>It gives me the same result over and over again. However, not the information schema, for some reason. What could be wrong with the database? Or maybe I just misunderstand the meaning of table_rows in information_schema?</p>