天天看点

mysql中profile性能分析工具使用

-- 查看profiling信息    
show variables like '%profiling%'; 
-- 开启profiling
set profiling = 1; 
-- 执行SQL查询 
select * from (select * from t_people p order by p.pname limit 100000) p left join t_team t on p.team_id=t.id limit  100000; 
-- 执行show profiles查看信息
show  profiles;
show profile for query 1;


1.profile是用户级变量,每次都得重新启用
2.需在终端使用,在phpmyadmin下无效
           

继续阅读