调优与监控

调优

1. MySQL Query Profile
 mysql>set profiling=1;
 mysql>show profiles;
 mysql>show profile for query 1;

 mysql> select min(seq) seq,state,count(*) numb_ops,
         -> round(sum(duration),5) sum_dur, round(avg(duration),5) avg_dur,
         -> round(sum(cpu_user),5) sum_cpu, round(avg(cpu_user),5) avg_cpu
         -> from information_schema.profiling
         -> where query_id = 10
         -> group by state
         -> order by seq;

 mysql> explain SQL;


监控
 mysql>show status;
 mysql>show table status;
 mysql>
 mysql>
 mysql>

你可能感兴趣的:(sql,mysql,user,table,query,profiling)