[英]Identity the run time of all the procedures to track the performance
I'm using a SQL Server database, we have 50-80 stored procedures which are being used by a .NET application.我正在使用 SQL 服务器数据库,我们有 50-80 个存储过程,这些存储过程正在被 .NET 应用程序使用。 But the application is very slow and returning the results with huge delay now a days, so I would like to identify the slow running stored procedure in the database.
但是应用程序非常慢,现在返回结果延迟很大,所以我想确定数据库中运行缓慢的存储过程。
Thanks in advance.提前致谢。
Have you looked at sys.dm_exec_procedure_stats ?你看过sys.dm_exec_procedure_stats了吗? You should at least get started with something like this:
你至少应该从这样的事情开始:
select
isnull(object_name(s.object_id, s.database_id), convert(varchar, object_id)) as name,
s.total_logical_reads,
s.total_worker_time,
s.total_elapsed_time,
s.execution_count,
cached_time,
last_execution_time
from
sys.dm_exec_procedure_stats s
order by
total_worker_time desc
option (recompile)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.