开发者

Performance tuning MYSQL Database

How can i log which all query is executed,how many secs a MYSQL query take to execute, to increase performance of开发者_运维知识库 database? I am using PHP


Use the slow query log for catching queries which run longer than a specified time limit (2 seconds by default). This will show you the worst offenders; probably many will be low-hanging fruit, fixable by proper indexes.

It won't catch a different type of code smell: a relatively fast query running many times in a tight loop.

If you wish, you may set the slow query limit to 0 and it will log all queries - note that this in itself will slow down the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜