扫码关注官方订阅号
比如:source schema.sql; schema.sql中含有超过100条insert命令(所以profile基本上就用不着了),我要怎么才能知道处理这个文件用了多少毫秒呢?
业精于勤,荒于嬉;行成于思,毁于随。
你没办法把默认的那个显示时间改成毫秒 ...
如果想要更精确的查询时间 ... 你需要开启 Profile ... 方法如下 ...
Profile
mysql> set profiling=1; Query OK, 0 rows affected (0.00 sec) mysql> select * from bigtable; 29121487 rows in set (0.00 sec) mysql> show profiles; +----------+------------+--------------------+ | Query_ID | Duration | Query | +----------+------------+--------------------+ | 1 | 0.00026925 | select * from user | +----------+------------+--------------------+ 1 row in set (0.00 sec) mysql> show profile; +--------------------------------+----------+ | Status | Duration | +--------------------------------+----------+ | starting | 0.000020 | | Waiting for query cache lock | 0.000005 | | checking query cache for query | 0.000028 | | checking permissions | 0.000008 | | Opening tables | 0.000019 | | System lock | 0.000011 | | init | 0.000033 | | optimizing | 0.000006 | | statistics | 0.000010 | | preparing | 0.000009 | | executing | 0.000004 | | Sending data | 0.000078 | | end | 0.000006 | | query end | 0.000003 | | closing tables | 0.000008 | | freeing items | 0.000016 | | logging slow query | 0.000004 | | cleaning up | 0.000005 | +--------------------------------+----------+ 18 rows in set (0.00 sec) mysql>
这是不错的性能分析器 ... 相关的资料也不少 ... 知道关键字之后自己看看吧 ...
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你没办法把默认的那个显示时间改成毫秒 ...
如果想要更精确的查询时间 ... 你需要开启
Profile... 方法如下 ...这是不错的性能分析器 ... 相关的资料也不少 ... 知道关键字之后自己看看吧 ...