库级优化之SHOW GLOBAL STATUS
慢查询
//查询慢线程情况 show global status like '%slow%' +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | Slow_launch_threads | 1 | | Slow_queries | 100 | +---------------------+-------+ 如果Slow_launch_threads值较大,说明有些东西正在延迟连接的新线程 //查询慢查询日志是否开启 show variables like '%slow%' +---------------------+--------------------------------------+ | Variable_name | Value | +---------------------+--------------------------------------+ |log_slow_admin_statements| ON | |log_slow_slave_statements| OFF | | slow_launch_time | 2 | | slow_query_log | ON | | slow_query_log_file | /home/mysql/mysql/slow_query.