Oracle 5.0 Reference Manual page 1212

Table of Contents

Advertisement

mysql>
CREATE TABLE T1 (id INT);
Query OK, 0 rows affected (0.01 sec)
mysql>
SHOW PROFILES;
+----------+----------+--------------------------+
| Query_ID | Duration | Query
+----------+----------+--------------------------+
|
0 | 0.000088 | SET PROFILING = 1
|
1 | 0.000136 | DROP TABLE IF EXISTS t1
|
2 | 0.011947 | CREATE TABLE t1 (id INT) |
+----------+----------+--------------------------+
3 rows in set (0.00 sec)
mysql>
SHOW PROFILE;
+----------------------+----------+
| Status
+----------------------+----------+
| checking permissions | 0.000040 |
| creating table
| After create
| query end
| freeing items
| logging slow query
| cleaning up
+----------------------+----------+
7 rows in set (0.00 sec)
mysql>
SHOW PROFILE FOR QUERY 1;
+--------------------+----------+
| Status
+--------------------+----------+
| query end
| freeing items
| logging slow query | 0.000015 |
| cleaning up
+--------------------+----------+
4 rows in set (0.00 sec)
mysql>
SHOW PROFILE CPU FOR QUERY 2;
+----------------------+----------+----------+------------+
| Status
+----------------------+----------+----------+------------+
| checking permissions | 0.000040 | 0.000038 |
| creating table
| After create
| query end
| freeing items
| logging slow query
| cleaning up
+----------------------+----------+----------+------------+
7 rows in set (0.00 sec)
Note
Profiling is only partially functional on some architectures. For values that
depend on the
as Windows that do not support the call. In addition, profiling is per process and
not per thread. This means that activity on threads within the server other than
your own may affect the timing information that you see.
and
SHOW PROFILES
You can also get profiling information from the
Section 19.7, "The
INFORMATION_SCHEMA PROFILING
produce the same result:
SHOW PROFILE FOR QUERY 2;
SELECT STATE, FORMAT(DURATION, 6) AS DURATION
FROM INFORMATION_SCHEMA.PROFILING
SHOW
| Duration |
| 0.000056 |
| 0.011363 |
| 0.000375 |
| 0.000089 |
| 0.000019 |
| 0.000005 |
| Duration |
| 0.000107 |
| 0.000008 |
| 0.000006 |
| Duration | CPU_user | CPU_system |
| 0.000056 | 0.000028 |
| 0.011363 | 0.000217 |
| 0.000375 | 0.000013 |
| 0.000089 | 0.000010 |
| 0.000019 | 0.000009 |
| 0.000005 | 0.000003 |
getrusage()
were added in MySQL 5.0.37.
SHOW PROFILE
1192
Syntax
|
|
|
0.000002 |
0.000028 |
0.001571 |
0.000028 |
0.000014 |
0.000010 |
0.000002 |
system call,
is returned on systems such
NULL
table in INFORMATION_SCHEMA. See
PROFILING
Table". For example, the following queries

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents