Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

It's a known issue that innodb is slow in

SELECT count(*) FROM Table

Hence I avoided that. But I notice that whenever I login to phpmyadmin, it will automatically execute a count(*) for my innodb table with 19k rows, which can take up to a minute to execute. Yet it doesn't initiate such count(*) for the other innodb table with 4 million rows.

Another clue, in phpmyadmin, under the Records column, the number of records for the 19k-row table is showing the exact value whereas the 4-million-row table is showing an approx.

I understand innodb table gives an estimation of the row count. But it seems that for smaller table, in this case with 19k rows, phpmyadmin decides to do a count(*) instead of just giving an estimation.

Question is, is there a way to stop phpmyadmin from doing such count on my innodb table? It's okay to just give an estimation instead of doing an expensive row count whenever I refresh my phpmyadmin screen.

share|improve this question

migrated from stackoverflow.com Mar 1 '11 at 12:12

This question came from our site for professional and enthusiast programmers.

Think I found the answer. There is a $cfg['MaxExactCount'] = 20000; in phpmyadmin settings. Only rows more than 20k will give an estimates. My next question is, where do I edit $cfg['MaxExactCount']? –  Kenny Feb 28 '11 at 1:40

1 Answer 1

Edit config.inc.php. Search this document for the string 'Almost all configurable data'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.