I'm working on a survey application that has an Android App and a Dashboard as well. We have hosted our code on our own server in Xampp and using MySQL database that is within Xampp. From this week we have observed that MySQL queries are taking a long time even this SELECT COUNT(*) FROM survey_data WHERE 1
simple query take more than 10 seconds to show the result in phpmyadmin. I searched over the internet and found a command that can show the locked table/s. And also show processlist
that lists the processes. I looked into it and found that one of my update queries was too heavy so I commented out that for now.
Then I observed that the count query that returns different count values to different users is being repeated again and again. We have about 45 users of Dashboard and that count query returns the values when they refresh the Dashboard But we have more than 16k Android users that submit data (5K to 15k records daily). below is the snapshot that shows more count query requests than the insert and update that should be way larger in amount than the Dashboard hits.
You can see there are more count processes than the insert and update (in the picture there is only 1 insert) and also count queries are taking a long time.
There should not be more count queries than insert and update.
Can you please let me know how to reduce the count query time. The queries in phpmyadmin take a long time too So I suppose I have to make some changes in the config files etc. to make it work. I already changed localhost to 127.0.0.1 in httpd.conf file.