标题: 请问sybase如何显示查询所用的时间 [打印本页] 作者: hiliunx 时间: 2010-06-09 13:25 标题: 请问sybase如何显示查询所用的时间 我在mysql 上面使用sql语句查询一个大表a,
select * from a 得到的结果会是 1600 rows in set (0.02sec),这个0.02sec就是花费的时间吧。
而我在sybase上面使用同样一条sql语句对a表进行查询
得到的结果会是 1600 rows affected 却没有所用的时间显示出来。是不是sybase不能显示出所用的时间,或者有什么办法可以让它显示所花费的时间?请教各位大侠。多谢作者: andkylee 时间: 2010-06-09 13:41
执行以下: set statistics time on
示例如下:
1>
2> set statistics time on
3> go
Execution Time 0.
Adaptive Server cpu time: 0 ms. Adaptive Server elapsed time: 0 ms.
1> select getdate()
2> go
Parse and Compile Time 0.
Adaptive Server cpu time: 0 ms.
--------------------------
Jun 9 2010 1:41PM
Execution Time 0.
Adaptive Server cpu time: 0 ms. Adaptive Server elapsed time: 0 ms.
Parse and Compile Time – the number of CPU ticks taken to parse, optimize, and compile the query. See below for information on converting ticks to milliseconds.(准备工作所使用的cpu时间片个数)
Adaptive Server cpu time – the CPU time in milliseconds.(以毫秒计时的cpu时间)
Execution Time – the number of CPU ticks taken to execute the query.(执行查询所用时间片个数)
Adaptive Server cpu time – the number of CPU ticks taken to execute the query, converted to milliseconds.(也是cpu花在查询上面的时间,不过是以毫秒计时)
Adaptive Server elapsed time – the difference in milliseconds between the time the command started and the current time, taken from the operating system clock.(以操作系统时间计算 命令开始执行到 查询结果完全显示出来 所用的时间(毫秒))。