开发者

Performance tuning MYSQL Database

开发者 https://www.devze.com 2023-01-16 14:59 出处:网络
How can i log which all query is executed,how many secs a MYSQL query take to execute, to increase performance of开发者_运维知识库 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

精彩评论

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