MySQL优化工具

问题描述:

任何人都可以建议一个好的MYSQL优化工具,该工具有助于查找长查询中的瓶颈,从而有助于优化吗?我正在寻找查询探查器.

Can anyone suggest a good MYSQL optimization tool which helps in finding the bottlenecks in a long query and hence help in optimization?? I am looking for a query profiler.

谢谢...

好,您是说查询优化?我猜EXPLAIN <query>对于给出瓶颈的位置很有帮助.之后,重新定义索引& ...

Well, You mean Query Optimization? I guess EXPLAIN <query> is excellent in giving hits as to where the bottlenecks are. After which redefine you indexes & ...

UPDATE1::您可以签出- MySQL优化工具

UPDATE1: You could check out - MySQL optimization tools

UPDATE2::深入研究我的代码后,我发现我曾经做过两件事来进行查询优化.

UPDATE2: After digging up in my code, I see that I used to do 2 things for query optimization.

  1. 打开慢速查询日志- MySQL可以在
  1. Turn on Slow Query Log - MySQL can record expensive SQL queries in the slow query log. You can define your expectations in seconds using parameter long_query_time.
  2. mysqldumpslow command - After logging is turned on you can analyze the log contents using mysqldumpslow command. mysqldumpslow /path/to/your/mysql-slow-queries.log -t 10. This will show you top 10 performance killers. For each statement in the output you can see the number of identical calls, execution time in seconds, rows affected and the statement itself.