Home >Backend Development >PHP Tutorial >thinkPHP网站某些控制器sql执行效率低,用什么方法监测出哪条sql导致的

thinkPHP网站某些控制器sql执行效率低,用什么方法监测出哪条sql导致的

WBOY
WBOYOriginal
2016-06-23 14:20:10926browse

thinkphp sql 优化

thinkPHP网站某些控制器sql执行效率低,用什么方法监测出哪条sql导致的

回复讨论(解决方案)

可以用mysql自带的慢查询分析,具体可以问百度

开启慢查询分析日志最直接

my.ini
log-slow-queries = YOU_LOG_DIR.mysqlslowquery.log
long_query_time = 1//超过秒数记录

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn