开发者

mysql - show profiles doesn't show me a query

Hallo guys. Someone can explain me why show profiles doesn't show me a query? This is the output of my attempt:

mysql> set profiling = 1;
Query OK, 0 rows affected (0.00 sec)

mysql> use slow;
Database changed
mysql> show profiles;
+----------+------------+-------------------+
| Query_ID | Duration   | Query             |
+----------+------------+-------------------+
|        1 | 0.00024275 | SELECT DATABASE() |
+----------+------------+-------------------+
1 row in set (0.00 sec)

mysql> select count(*) from people;
+----------+
| count(*) |
+----------+
|   500000 |
+----------+
1 row in set (0.00 sec)

mysql> show profiles;
+----------+------------+-----------------------------+
| Query_ID | Duration   | Query                       |
+----------+------------+-----------------------------+
|        1 | 0.00024275 | SELECT DATABASE()           |
|        2 | 0.00030825 | select count(*) from people |
+----------+------------+-----------------------------+
2 rows in set (0.00 sec)

mysql> select
    -> concat_ws('-',min(age(dob)),max(age(dob))) as year,
    -> count(*) as total
    -> from people
    -> group by if(age(dob)=0,1,ceil(age(dob)/5))
    -> ;
+---------+-------+
| years   | total |
+---------+-------+
| 0-5     | 29789 |
| 6-10    | 24847 |
| 11-15   | 24670 |
| 16-20   | 24764 |
| 21-25   | 24751 |
| 26-30   | 24753 |
| 31-35   | 24817 |
| 36-40   | 24505 |
| 41-45   | 24540 |
| 46-50   | 24745 |
| 51-55   | 24575 |
| 56-60   | 24441 |
| 61-65   | 24953 |
| 66-70   | 24760 |
| 71-75   | 24586 |
| 76-80   | 24647 |
| 81-85   | 24819 |
| 86-90   | 24879 |
| 91-95   | 24683 |
| 96-100  | 24829 |
| 101-101 |   647 |
+---------+-------+
21 rows in set (31.42 sec)

mysql> show profiles;
+----------+------------+-----------------------------+
| Query_ID | Duration   | Query                       |
+----------+------------+-----------------------------+
|        1开发者_JAVA技巧 | 0.00024275 | SELECT DATABASE()           |
|        2 | 0.00030825 | select count(*) from people |
+----------+------------+-----------------------------+
2 rows in set (0.00 sec)

Thanks in advance.


I couldn't find any reference either and so think it is a bug:

http://bugs.mysql.com/bug.php?id=61328


Profiling is not supported when using Stored Functions.
See the bug report and this SQLyog Issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜