如何跟踪慢速运行的存储过程? [英] How to trace slow running stored procedure?

查看:159
本文介绍了如何跟踪慢速运行的存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,



对于我的Winform应用程序,我使用sql server 2005作为后端。



Companyinfo 表中有超过9个lacs条目。 emailinfo 表中大约有10个lacs数据,这是表。





目前我正在使用存储过程插入50行,



这个sp非常复杂,其中我检查重复的条目,更新重复条目的状态,类别,日期,用户等。



目前有10个用户。



过去15天,这个sp工作缓慢,显示

超时已过期超时时间

错误通常。



我使用sql profiler跟踪sp,它显示

 CPU:4094 

读取236310 写入40



i设置服务器事务超时= 40



我的其他重存储过程数据库工作正常,从中我我会在几秒钟内插入1000行。



请帮我解决这个问题。



提前致谢



抱歉英语不好。

解决方案

阅读这篇文章。这对你有帮助..

使用这些提示加速SQL Server数据库查询 [ ^ ]

使用PREFETCH加速SQL Server查询 [ ^ ]


你好udusat1,



我认为这不是你的SP的问题,它没有正确编入索引,首先检查完整性约束是否在表上,并在表上实现索引,以便它会提高你的数据库上的crud操作速度。



谢谢

SP

Hi Expert,

For My Winform application, I have Used sql server 2005 as Backend.

There are more than 9 lacs entries in a Companyinfo table.and Around 10 lacs data in emailinfo table which is secondory Table.


Currently i am inserting 50 rows using stored procedure,

This sp is very complex,in which i am checking duplicate entries,updating status,category,date,user etc of duplicate entries.

Currently there are 10 users.

from last 15 days, this sp working slow,and showing

timeout expired the timeout period elapsed

error usually.

I have traced sp using sql profiler,it shows

CPU : 4094

, reads 236310 writes 40

i set server transaction timeout=40

My other heavy stored procedure for same databse working fine,from which i am inserting 1000 rows within seconds.

Please Help me to sort this problem.

Thanks in advance

And sorry for poor english.

解决方案

read this articles. this will help you..
Speed up SQL Server database queries with these tips[^]
Speed up SQL Server queries with PREFETCH[^]


Hi udusat1,

I think this is not the problem with your SP, it is not properly indexed, first check integrity constraints are their on the tables or not, and implement indexing on the tables, so that it will increase speed of crud operations on your database.

Thanks
SP


这篇关于如何跟踪慢速运行的存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆