Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I ran this select from information_schema to get the count of a table with aprox 1.2 million rows. each time I run the query, though, the number returned is different. it seems to vary by about 200k either way. does anybody know why that would be happening?


It's just an estimate for the query engine, not a true row count. But good enough for a progress bar.

From http://dev.mysql.com/doc/refman/5.0/en/tables-table.html:

> For InnoDB tables, the row count is only a rough estimate used in SQL optimization.


If you run it a dozen times, it converges on the truth.


aha, thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: