免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 12193 | 回复: 52
打印 上一主题 下一主题

请问如何查询mysql中执行效率低的sql语句? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-04 10:46 |只看该作者 |正序浏览
请问如何查询mysql中执行效率低的sql语句?
最好能查询正在执行的效率低的sql语句,好像在oracle中查询v$sqltext一样?很多文章都讲到explain的方法,我想问问有没有即时的查询分析方法?

论坛徽章:
0
53 [报告]
发表于 2006-04-05 16:21 |只看该作者
谢谢,我现在明白了

论坛徽章:
0
52 [报告]
发表于 2006-04-05 15:04 |只看该作者
-0, --log-long-format
                      Log some extra information to update log. Please note that this option is deprecated; see --log-short-format option.

--log-short-format  Don't log extra information to update and slow-query logs.

--log-slow-queries[=name]
                      Log slow queries to this log file. Defaults logging to
                      hostname-slow.log file. Must be enabled to activate other
                      slow log options.

--slow_launch_time=#
                      If creating the thread takes longer than this value (in
                      seconds), the Slow_launch_threads counter will be
                      incremented.

论坛徽章:
0
51 [报告]
发表于 2006-04-05 14:00 |只看该作者
原帖由 rardge 于 2006-4-5 12:05 发表
有点看不惯这个东西:log-long-format,把它去掉再看看。
就算死马当活马医吧,呵呵
其他的,实在不知道了。



哈哈,你这个意见还真管用呀,我把那个log-long-format去掉就达到要求了,

论坛徽章:
0
50 [报告]
发表于 2006-04-05 12:11 |只看该作者
是啊,现在只能按照兄弟你说的这么试下了,再不行就没辙了!

论坛徽章:
0
49 [报告]
发表于 2006-04-05 12:05 |只看该作者
有点看不惯这个东西:log-long-format,把它去掉再看看。
就算死马当活马医吧,呵呵
其他的,实在不知道了。

论坛徽章:
0
48 [报告]
发表于 2006-04-05 11:55 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
47 [报告]
发表于 2006-04-05 11:29 |只看该作者
很奇怪,是不是跟环境有什么关系呀?
我的环境是:red hat linux8.0+mysql4.0.12

论坛徽章:
0
46 [报告]
发表于 2006-04-05 11:19 |只看该作者
my.cnf中定义的变量是不是都是系统全局变量呀?

论坛徽章:
0
45 [报告]
发表于 2006-04-05 11:17 |只看该作者
show global variables like 'log%'
得到了log_slow_queries=ON,我想把它设置成/etc/my.cnf的值一致
set global log_slow_queries='/var/log/slowquery.log'
居然报错说,没有这个系统变量,奇怪呀!
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP