27.MySQL Status

1.MyISAM 表锁状态

show status like 'table%';

Table_locks_immediate | 136  
Table_locks_waited    | 4
2.InnoDB 行锁状态
show status like 'innodb_row%';

| Innodb_row_lock_current_waits | 0     |
| Innodb_row_lock_time          | 0     |
| Innodb_row_lock_time_avg      | 0     |
| Innodb_row_lock_time_max      | 0     |
| Innodb_row_lock_waits         | 0     |

3.各种语句执行情况

show status like 'com_%';

| Com_select                 | 11    |
| Com_update                 | 0     |
...

4.服务器运行时间

show status like 'uptime';

5.索引使用情况

show status like 'handler_read%';

| Handler_read_first       | 0     |
| Handler_read_key         | 6     |  //使用到的索引次数
| Handler_read_last        | 0     |
| Handler_read_next        | 0     |
| Handler_read_prev        | 0     |
| Handler_read_rnd         | 0     |
| Handler_read_rnd_deleted | 0     |
| Handler_read_rnd_next    | 631   | //值越高,索引效率越低

6.MySQL 连接次数

show status like 'connections';

7.慢查询次数

show status like 'slow_queries';

8.表缓存

show status like 'open_tables'; //当前打开的表缓存

show status like 'opened_tables'; //曾经打开的表缓存


9. show status like 'last_query_cost'; // 查询成本

| Last_query_cost | 1.799000 |


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值