MYSQL why is it sometimes too slow ?

Hello experts,
we have a small database in mysql,
its usually performs really fast
but  sometimes when requesting a very simple query
 it will take too long to respond... like 30 secs o more... and its a very simple query.
and the table is too small....
I have noticed that maybe there are other connections still open and i think not operating.
Could this be the cause and if so what tools do i have to control this ?
Regards
RGuillermoProject ManagerAsked:
Who is Participating?
 
theGhost_k8Connect With a Mentor Database ConsultantCommented:
Hi,

Try to debug that when this repeats & collect following information from mysql:
show engine innodb status\G
show full processlist;

Also, if this is specific query, check with explain plan and share it with us along with table definition(s), if you can.

see if there's some external process holding your queries; most commonly backups.
0
 
Ryan ChongCommented:
you may try to debug via the execution plan to see if there's any abnormalities?

7.4 Visual Explain Plan
https://dev.mysql.com/doc/workbench/en/wb-performance-explain.html
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
I would say that when having multiple connections accessing the table at same time, you will face this poor query performance.
Do you have any index created in that table?
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
RGuillermoProject ManagerAuthor Commented:
Thanks to all Experts, it took us a while test all posibilites
0
 
theGhost_k8Database ConsultantCommented:
It'd be better if you can post your findings for people who come surfing here.
0
 
RGuillermoProject ManagerAuthor Commented:
Two findings.
1. We improved the design of our database... normalizing and eliminating reduce where possible.
2. having adequate indexes and not too many
3. when executing queries be careful with search criteria......
4. If all the above are met very likely you get a fine performance or at least acceptable.
All these come from our programmers...
Regards
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.