mysql性能优化之 show profile

很漂亮的结果,没有creating sort index

是没有sort index了,但感觉也不快,100ms,如果offset很大的话,会不会依然是个攻击点?

不需要快,只要cpu占用降下来即可

 

mysql> show profile for query 1;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000116 |
| checking permissions | 0.000010 |
| Opening tables       | 0.000025 |
| init                 | 0.000042 |
| System lock          | 0.000012 |
| optimizing           | 0.000019 |
| statistics           | 0.018801 |
| preparing            | 0.000038 |
| Sorting result       | 0.000004 |
| executing            | 0.000003 |
| Sending data         | 0.003294 |
| end                  | 0.000007 |
| query end            | 0.000010 |
| closing tables       | 0.000012 |
| freeing items        | 0.000019 |
| cleaning up          | 0.000020 |
+----------------------+----------+
16 rows in set, 1 warning (0.00 sec)

mysql> show profile for query 2;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000106 |
| checking permissions | 0.000010 |
| Opening tables       | 0.000026 |
| init                 | 0.000043 |
| System lock          | 0.000011 |
| optimizing           | 0.000020 |
| statistics           | 0.000132 |
| preparing            | 0.000034 |
| Sorting result       | 0.000004 |
| executing            | 0.000003 |
| Sending data         | 0.001174 |
| end                  | 0.000007 |
| query end            | 0.000010 |
| closing tables       | 0.000013 |
| freeing items        | 0.000020 |
| cleaning up          | 0.000065 |
+----------------------+----------+
16 rows in set, 1 warning (0.00 sec)
mysql> show profile for query 3;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000108 |
| checking permissions | 0.000010 |
| Opening tables       | 0.000027 |
| init                 | 0.000044 |
| System lock          | 0.000011 |
| optimizing           | 0.000020 |
| statistics           | 0.000125 |
| preparing            | 0.000035 |
| Sorting result       | 0.000004 |
| executing            | 0.000003 |
| Sending data         | 0.004072 |
| end                  | 0.000019 |
| query end            | 0.000011 |
| closing tables       | 0.000013 |
| freeing items        | 0.000019 |
| cleaning up          | 0.000039 |
+----------------------+----------+
16 rows in set, 1 warning (0.00 sec)

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值