MySQL查询优化:profile功能(2)

mysql> show profiles;
+----------+-------------+------------------------------------------------+
| Query_ID | Duration    | Query                                          |
+----------+-------------+------------------------------------------------+
|        1 |  0.02717000 | show tables                                    |
|        2 |  0.74770100 | select count(*) from t                        |
|        3 |  0.00004200 | show prifile for query 2                      |
|        4 | 34.30410100 | insert into t(username) select username from t |
+----------+-------------+------------------------------------------------+
4 rows in set (0.00 sec)

mysql> show profile cpu,block io,memory,swaps for query 4;

mysql> select count(*) from t;
+----------+
| count(*) |
+----------+
|  4194304 |
+----------+
1 row in set (1.51 sec)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/74dcb60173c972f3820dce9c80773154.html