首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mysql - show profile没有显示查询

mysql - show profile没有显示查询
EN

Stack Overflow用户
提问于 2011-02-18 09:29:46
回答 2查看 1.3K关注 0票数 1

你们好伙计们。有人能解释一下为什么show profile不给我显示查询吗?这是我尝试的输出:

代码语言:javascript
复制
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 | 0.00024275 | SELECT DATABASE()           |
|        2 | 0.00030825 | select count(*) from people |
+----------+------------+-----------------------------+
2 rows in set (0.00 sec)

提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2011-05-27 22:37:08

我也找不到任何参考资料,所以我认为这是一个bug:

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

票数 0
EN

Stack Overflow用户

发布于 2012-11-29 15:48:57

使用存储函数时不支持分析。

请参阅bug report和此SQLyog Issue

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5036780

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档