Mysql> set profiling = 1;
Mysql> show profiles;
Mysql> set @ query_id = 6;
Query OK, 0 rows affected (0.00 Sec)
Mysql> select state, sum (duration) as total_r, round (100 * sum (duration)/(select sum (duration) from information_schema.profiling where [email protected] _ id), 2) as pct_r, count (*) as CILS, sum (duration)/count (*) as "r/call" from information_schema.profiling where [email protected] _ id group by state order by total_r DESC;
+ ---------------------- + ---------- + ------- + -------------- +
| State | total_r | pct_r | CILS | r/CALL |
+ ---------------------- + ---------- + ------- + -------------- +
| Sending data | 0.026548 | 44.76 | 1 | 0.0265480000 |
| Init | 0.025457 | 42.92 | 1 | 0.0254570000 |
| System lock | 0.005633 | 9.50 | 1 | 0.0056330000 |
| Query end | 0.001312 | 2.21 | 1 | 0.0013120000 |
| Freeing items | 0.000155 | 0.26 | 1 | 0.0001550000 |
| Starting | 0.000076 | 0.13 | 1 | 0.0000760000 |
| Opening tables | 0.000029 | 0.05 | 1 | 0.0000290000 |
| Statistics | 0.000019 | 0.03 | 1 | 0.0000190000 |
| Cleaning up | 0.000019 | 0.03 | 1 | 0.0000190000 |
| Closing tables | 0.000017 | 0.03 | 1 | 0.0000170000 |
| End | 0.000015 | 0.03 | 1 | 0.0000150000 |
| Preparing | 0.000012 | 0.02 | 1 | 0.0000120000 |
| Optimizing | 0.000011 | 0.02 | 1 | 0.0000110000 |
| Checking permissions | 0.000011 | 0.02 | 1 | 0.0000110000 |
| Executing | 0.000002 | 0.00 | 1 | 0.0000020000 |
+ ---------------------- + ---------- + ------- + -------------- +