查看执行时间

1 show profiles; 
2 show variables;查看profiling 是否是on状态; 
3 如果是off,则 set profiling = 1; 
4 执行自己的sql语句; 
5 show profiles;就可以查到sql语句的执行时间;

实例操作:

mysql> show variables like '%profiling%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| have_profiling | YES |
| profiling | ON |
| profiling_history_size | 15 |
+------------------------+-------+
3 rows in set (0.14 sec) 如果 profiling 是off, 则 mysql> set profiling=1; 执行自己的 sql 语句后 mysql> show profiles;
+----------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query_ID | Duration | Query |
+----------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | 55.04466800 | select a.s*****************otScore, a.hot_star as hotLevel, b.title as itemName, b.pic_url as picUrl,
ifnull(b.cprice,b.sprice) as price, b.first_day_sale as sale
from ( select item_id, shop_id, zhiyi_tag, hot_score, hot_s |

mysql 如何查看sql语句执行时间的更多相关文章

  1. mysql 如何查看sql语句执行时间和效率

    查看执行时间 1 show profiles; 2 show variables;查看profiling 是否是on状态: 3 如果是off,则 set profiling = 1: 4 执行自己的s ...

  2. 查看SQL语句执行时间与测试SQL语句性能

    查看SQL语句执行时间与测试SQL语句性能 写程序的人,往往需要分析所写的SQL语句是否够优化.是否能提升执行效率,服务器的响应时间有多快,这个时候就需要用到SQL的STATISTICS状态值来查看了 ...

  3. 转:查看sql语句执行时间/测试sql语句性能

    原文出处:http://www.cnblogs.com/qanholas/archive/2011/05/06/2038543.html 写程序的人,往往需要分析所写的SQL语句是否已经优化过了,服务 ...

  4. 查看sql语句执行时间/测试sql语句性能

    写程序的人,往往需要分析所写的SQL语句是否已经优化过了,服务器的响应时间有多快,这个时候就需要用到SQL的STATISTICS状态值来查看了. 通过设置STATISTICS我们可以查看执行SQL时的 ...

  5. mysql查看sql语句执行时间

    原文地址: http://www.cnblogs.com/happySmily/p/5943311.html

  6. 查看SQL语句执行时间

    DBCC FREEPROCCACHE;SET STATISTICS PROFILE ON SET STATISTICS IO ON SET STATISTICS TIME ON go--SQL开始** ...

  7. 查看SQL语句执行时间、IO开销

    SET STATISTICS TIME ON SET STATISTICS IO ON或者set statistics io,time on

  8. sqlserver 测试sql语句执行时间

    查看sql语句执行时间/测试sql语句性能 写程序的人,往往需要分析所写的SQL语句是否已经优化过了,服务器的响应时间有多快,这个时候就需要用到SQL的STATISTICS状态值来查看了. 通过设置S ...

  9. sql中的系统表sysobjects以及如何查看sql语句的执行时间

    使用sysobjects可以快速查看数据库中表.视图.存储过程.触发器.约束等的信息. 大牛文章:http://www.cnblogs.com/atree/p/SQL-Server-sysobject ...

随机推荐

  1. hdu 4111 Alice and Bob 记忆化搜索 博弈论

    Alice and Bob Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pi ...

  2. jquery datatables使用

    引入相应css 和js <link href="http://cdn.datatables.net/1.10.5/css/jquery.dataTables.css" rel ...

  3. Linear regulator=low-cost dc/dc converter

    The circuit in Figure 1 is a good choice if you need a power supply with high efficiency and you don ...

  4. python笔记18-sort和sorted区别

    前言 python的排序有两个方法,一个是list对象的sort方法,另外一个是builtin函数里面sorted,主要区别: sort仅针对于list对象排序,无返回值, 会改变原来队列顺序 sor ...

  5. python爬虫beautifulsoup4系列4-子节点

    前言 很多时候我们无法直接定位到某个元素,我们可以先定位它的父元素,通过父元素来找子元素就比较容易 一.子节点 1.以博客园首页的摘要为例:<div class="c_b_p_desc ...

  6. linux查看进程信息 so依赖

    查看进程ps -A PID进程的sopmap -x pid

  7. 判断浏览器内核JS代码

    <script type="text/javascript"> var Sys = {}; var ua = navigator.userAgent.toLowerCa ...

  8. 分享一个 markdown 编辑器 - Mditor

    只求极致 [ M ] arkdown + E [ ditor ] = Mditor Mditor 是一个简洁.易于集成.方便扩展.期望舒服的编写 markdown 的编辑器,仅此而已... 主页: h ...

  9. hadoop文件系统与I/O流

    本文地址:http://www.cnblogs.com/archimedes/p/hadoop-filesystem-io.html,转载请注明源地址. hadoop借鉴了Linux虚拟文件系统的概念 ...

  10. MapReduce开发技巧

    数据类型的选择 自定义数据类型 参考:Hadoop提交作业自定义排序和分组 MapWritable/SortedMapWritable Hadoop中可传输的Map集合,和Java中的Map用法差不多 ...