Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way which I can have MySQL record its queries and their Explain so that I can figure out how to index the expensive stuff? I'm new to this stuff. Thank you.

share|improve this question

Try looking at maatkit. Particularly mk-query-digest. http://www.maatkit.org/doc/mk-query-digest.html

share|improve this answer
    
There is also pt-query-digest. +1 nonetheless. – RolandoMySQLDBA Mar 20 '13 at 16:40

First use log-queries-not-using-indexes Then use explain on them to see possible indexes

share|improve this answer

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.