关于SHOW PROFILE的问题
1:
mysql> select version();
+----------------------+
| version() |
+----------------------+
| 5.1.42-community-log |
+----------------------+
1 row in set (0.00 sec)
WINDOWS版本
2:
mysql> set profiling=1;
Query OK, 0 rows affected (0.00 sec)
3:
mysql> show profiles;
+----------+------------+---------------------------------------------------
| Query_ID | Duration | Query
+----------+------------+---------------------------------------------------
| 1 | 0.00008600 | show profilies
| 2 | 0.02014275 | SELECT count(*) from terminal_alarm_list as t
where t.createtime > date_add(now(),interval -7 day) |
| 3 | 0.00008700 | show version()
| 4 | 0.00013275 | select version()
| 5 | 0.00011200 | set profiling=1
+----------+------------+---------------------------------------------------
5 rows in set (0.00 sec)
4:
mysql> show profile cpu,block io for query 2;
+--------------------+----------+----------+------------+--------------+---------------+
| Status | Duration | CPU_user | CPU_system | Block_ops_in | Block_ops_out |
+--------------------+----------+----------+------------+--------------+---------------+
| starting | 0.000095 | NULL | NULL | NULL | NULL |
| Opening tables | 0.000446 | NULL | NULL | NULL | NULL |
| System lock | 0.000005 | NULL | NULL | NULL | NULL |
| Table lock | 0.000008 | NULL | NULL | NULL | NULL |
| init | 0.000020 | NULL | NULL | NULL | NULL |
| optimizing | 0.000020 | NULL | NULL | NULL | NULL |
| statistics | 0.000130 | NULL | NULL | NULL | NULL |
| preparing | 0.000008 | NULL | NULL | NULL | NULL |
| executing | 0.000005 | NULL | NULL | NULL | NULL |
| Sending data | 0.019367 | NULL | NULL | NULL | NULL |
| end | 0.000004 | NULL | NULL | NULL | NULL |
| query end | 0.000003 | NULL | NULL | NULL | NULL |
| freeing items | 0.000025 | NULL | NULL | NULL | NULL |
| logging slow query | 0.000004 | NULL | NULL | NULL | NULL |
| cleaning up | 0.000004 | NULL | NULL | NULL | NULL |
+--------------------+----------+----------+------------+--------------+---------------+
15 rows in set (0.00 sec)
问题:
在这里,我看不到CPU和IO的数值,都是NULL
------解决方案--------------------ding
------解决方案--------------------
这个CPU_user | CPU_system 需要操作系统支持getrusage() ,而WINDOWS操作系统并不支持。所以在WINDOWS下只能显示NULL了。