最频繁执行的存储过程,执行次数最多的存储过程
cached_time上次编译时间,
execution_count上次编译以来执行的次数,
datediff(mi,cached_time,getdate())上次编译以来的分钟数
count/minute每分钟执行次数
--存储过程执行次数排序 --cached_time上次编译时间, --execution_count上次编译以来执行的次数, --datediff(mi,cached_time,getdate())上次编译以来的分钟数 --count/minute每分钟执行次数 SELECT TOP 20 OBJECT_NAME(object_id, database_id) 'procname' ,execution_count/datediff(mi,cached_time,getdate()) as 'count/minute' ,d.execution_count,datediff(mi,cached_time,getdate()) as 'minute' ,d.cached_time,d.last_execution_time ,db_name(d.database_id ) as dbname,d.object_id , d.total_elapsed_time ,d.total_elapsed_time/d.execution_count AS [avg_elapsed_time] ,d.last_elapsed_time FROM sys.dm_exec_procedure_stats AS d ORDER BY 'count/minute' DESC;