I use MySQL in a fairly complex web site (PHP driven).
Ideally, there would be a tool I could use that would help me test the SQL queries I am using and suggest better table indexes that will improve performance and avoid table scans.
Failing that, something that will tell me exactly what each query is up to, so I can perform the optimisation myself.
Edit: a simple guide to understanding the output from EXPLAIN ... would also be useful.
Thank you.
Here's some info about EXPLAIN (referenced from the High Performance MySQL book from O'Reilly):
When you run an EXPLAIN on a query, it tells you everything MySQL knows about that query in the form of reports for each table involved in the query.
Each of these reports will tell you...
The book is completely awesome at providing information like this, so if you haven't already, get your boss to sign off on a purchase.
Otherwise, I hope some more knowledgeable SO user can help :)
As a simplest thing, enable Slow Query Log and see what queries are slow, then try to analyze them as suggested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With