Query:
SELECT DISTINCT TOP 10 t.TEXT QueryName, s.execution_count AS ExecutionCount, s.max_elapsed_time AS MaxElapsedTime, ISNULL(s.total_elapsed_time / 1000000 / NULLIF(s.execution_count, 0), 0) AS AvgElapsedTimeSeconds, s.creation_time AS LogCreatedOn, 24 *(ISNULL((s.execution_count * 1.0) / NULLIF(DATEDIFF(hh, s.creation_time, GETDATE()), 0), 0)) AS FrequencyPer24Hr FROM sys.dm_exec_query_stats s CROSS APPLY sys.dm_exec_sql_text( s.sql_handle ) t ORDER BY AvgElapsedTimeSeconds DESC
The results I get include one record that has "CREATE PROCEDURE..." in it. Its also the highest in terms of how long its taking.
What the heck can I imply from this? The procedure is being re-compiled? If so, what could be causing this?