Home All Groups Group Topic Archive Search About

Query posting wrong information



Author
17 Apr 2007 6:00 PM
Greg Larsen
Why does this query post the wrong total_elapsed_time?  Note you need to run
this query twice to see results. 

select execution_count abc_exe_count,
       total_elapsed_time,
       qt.sql_handle,
       last_execution_time,
       statement_end_offset, text
   from sys.dm_exec_query_stats qt
cross apply sys.dm_exec_sql_text(qt.sql_handle)  
where text like '%abc_exe_count%'
order by last_execution_time desc

Author
17 Apr 2007 6:36 PM
Russell Fields
Greg,

Time is in microseconds on 2005, not milliseconds.  When I run it, the
answer looks about right.

RLF
Show quoteHide quote
"Greg Larsen" <gregalar***@removeit.msn.com> wrote in message
news:AB907027-DBE1-40E6-A172-C9E2794EDE7F@microsoft.com...
> Why does this query post the wrong total_elapsed_time?  Note you need to
> run
> this query twice to see results.
>
> select execution_count abc_exe_count,
>       total_elapsed_time,
>       qt.sql_handle,
>       last_execution_time,
>       statement_end_offset, text
>   from sys.dm_exec_query_stats qt
> cross apply sys.dm_exec_sql_text(qt.sql_handle)
> where text like '%abc_exe_count%'
> order by last_execution_time desc
Are all your drivers up to date? click for free checkup

Author
17 Apr 2007 6:44 PM
Greg Larsen
Thanks for the answer.   No matter how many times I read the BOL, I also read
milli, instead of micro. 

Show quoteHide quote
"Russell Fields" wrote:

> Greg,
>
> Time is in microseconds on 2005, not milliseconds.  When I run it, the
> answer looks about right.
>
> RLF
> "Greg Larsen" <gregalar***@removeit.msn.com> wrote in message
> news:AB907027-DBE1-40E6-A172-C9E2794EDE7F@microsoft.com...
> > Why does this query post the wrong total_elapsed_time?  Note you need to
> > run
> > this query twice to see results.
> >
> > select execution_count abc_exe_count,
> >       total_elapsed_time,
> >       qt.sql_handle,
> >       last_execution_time,
> >       statement_end_offset, text
> >   from sys.dm_exec_query_stats qt
> > cross apply sys.dm_exec_sql_text(qt.sql_handle)
> > where text like '%abc_exe_count%'
> > order by last_execution_time desc
>
>
>

Bookmark and Share