1

We're running the following very simple mysql query through phpmyadmin

SELECT * FROM ProcessedListAssociations

We know the correct result has 751331 rows but successive runs of the query return different row counts - anywhere from 749978 to 752165 rows. At least that's what the row count message at the top of the phpmyadmin result page says: Showing rows 0 - 24 (752165 total, Query took 0.0005 seconds.)

Running the query from a php script seems to return a result with the correct number of rows.

Running the following query from phpmyadmin:

SELECT count(*) FROM ProcessedListAssociations

also returns the correct result (751331)

We have recreated the table from scratch & still observe the same issue.

The table is an innoDB table. Here's basic info as phpmyAdmin reports it: Space usage Data 68.6 MiB Index 136.3 MiB Total 204.9 MiB Row statistics Format Compact Collation utf8_general_ci Next autoindex 751,332

Could it have something to do with concurrency? The server has 4 E7-4870 processors (80 threads total) but in the php.ini thread Safety is disabled. If that is indeed the problem, then why are we only observing it in phpmyadmin and not with our own php scripts too?

Chris K
  • 21
  • 4
  • 1
    more likely they using mysqli_num_rows at a bad time, it doesnt return correctly unless you setup it properly – gia Aug 31 '18 at 18:19
  • Possible duplicate of [incorrect table rowcount in mysql](https://stackoverflow.com/questions/18607675/incorrect-table-rowcount-in-mysql) – philipxy Sep 01 '18 at 03:21
  • Hi. This is a faq. Please always google many clear, concise & specific versions/phrasings of your question/problem/goal with & without your particular strings/names & read many answers. Add relevant keywords you discover to your searches. If you don't find an answer then post, using use one variant search for your title & keywords for your tags. See the downvote arrow mouseover text. – philipxy Sep 01 '18 at 03:25
  • @philipxy if you are going to go mini mod at least do the full work, thats not the 'prime' answer, just the one i linked and you copy pasted (in other words you linked to a possible duplicate), also make sure the prime question and answer are descriptive enough that they can be found in the first place (the one you are linking doesnt say phpmyadmin on the title but hidden later, same with others) – gia Sep 01 '18 at 03:45

1 Answers1

2

See the answer for incorrect table rowcount in mysql

https://phpmyadmin.readthedocs.io/en/latest/faq.html?highlight=MaxExactCount#the-number-of-rows-for-innodb-tables-is-not-correct

gia
  • 757
  • 5
  • 19
  • Thank you! This was very helpful! – Chris K Aug 31 '18 at 19:06
  • Please do not answer duplicate questions; flag or vote to close them. Please do not post link-only answers; put text necessary to explain in your answer. But don't answer duplicates. – philipxy Sep 01 '18 at 03:24