Skip to content

Instantly share code, notes, and snippets.

@jetstreamin
Created October 7, 2018 22:28
Show Gist options
  • Save jetstreamin/240c18eeabfc51aa5be4f94e9098768f to your computer and use it in GitHub Desktop.
Save jetstreamin/240c18eeabfc51aa5be4f94e9098768f to your computer and use it in GitHub Desktop.
Get Estimated SP Execution Time
SELECT TOP 10 d.object_id, d.database_id, OBJECT_NAME(object_id, database_id) 'proc name',
d.cached_time, d.last_execution_time, d.total_elapsed_time,
d.total_elapsed_time/d.execution_count AS [avg_elapsed_time],
d.last_elapsed_time, d.execution_count
FROM sys.dm_exec_procedure_stats AS d
WHERE OBJECT_NAME(object_id, database_id) = 'sp_GlobalIndex_IncrementalUpdate_GetDocuments'
ORDER BY [total_worker_time] DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment