• Hi, Thanks for sharing script for finding top CPU queries.

    select

    servername,runtime,max(DBName) as DBName,max(QueryExecuted) as QueryExecuted,(sum(total_worker_time)/sum(execution_count))/@ConvertMiliSeconds as AvgCPUTime

    ,sum(execution_count) as execution_count,query_hash, max(ObjectName) as ObjectName

    into ##FindTopCPUQueries_set2

    from ##FindTopCPUQueries_set1

    group by query_hash,servername,runtime

    order by AvgCPUTime desc

    could you explain me? AvgCPUTime

    As per output, there is one query taking too much time as below

    AvgCPUTime = 136722

    execution_count = 25,

    So, what is the per execution time?

    per execution = 136722/25 = 5468 (is it milliseconds or seconds)

    Thanks

    ananda