Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Are there any open source MySQL performance tools to help optimize SQL queries?

share|improve this question
    
explain <query>. –  jordanm Apr 4 '13 at 4:19
add comment

2 Answers

I think you should look at these blogs.

http://www.mysqlperformanceblog.com/

share|improve this answer
    
You have been around long enough to know not to just post links... –  jasonwryan Apr 4 '13 at 6:46
    
@jasonwryan: Sorry for that. –  pradeepchhetri Apr 4 '13 at 6:47
add comment

To profile a mysql command you could use SHOW PROFILE

mysql> SET profiling = 1;
mysql> [type your query here]
mysql> SHOW PROFILE;

and to get more information about what mysql would do in order to get your desired result, you could use EXPLAIN.

mysql> EXPLAIN [type your query here]

Good starting points for optimizations are the usage of indices and the increase of memory usage in my.cnf (the default parameters could be very low). If you delete a lot of data in a table OPTIMIZE TABLE could also be helpful.

OPTIMIZE TABLE table;

In any case you should use the output of SHOW PROFILE to determine which parts need a lot of time and are worth to be optimized.

Be aware to switch of the query cache while optimizing. You would trick yourself otherwise.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.