时间消耗存储过程 [英] Time Consuming Stored Procedure

查看:75
本文介绍了时间消耗存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中包含将近10个缺乏记录的表,例如:-

I have a table containing almost 10 lacks number of records like :-

ID________Data______Data1_____Batch1_______Batch2
1_________1000______AHDG________01___________01
2_________1001______KJFN________01___________01
3_________1002______LDET________02___________01
4_________1003______PLSI________02___________01
5_________1004______NCBD________03___________01
6_________1005______ZXIR________03___________01
7_________1006______PLAS________01___________02
8_________1007______VBTY________01___________02
9_________1008______PAZM________02___________02
10________1009______LKKL________02___________02
11________1010______VNBG________03___________02
12________1011______SKSJ________03___________02



我创建了一个存储过程,其输出如下:-



I have created a stored procedure which gives output as follows :-

ID________Start______End_______Total___Batch1___Batch2
1_________1000______1001________2_______1________1
2_________1002______1003________2_______2________1
3_________1004______1005________2_______3________1
4_________1006______1007________2_______1________2
5_________1008______1009________2_______2________2
6_________1010______1011________2_______3________2



问题在于,此存储过程花费太多时间来对10个Lacks记录进行分组(1小时2分钟).
我试图在几列上建立索引,但没有效果.
请咨询.



The problem is that, this stored procedure is taking too much time to group 10 Lacks records (1hr,2mins).
I have tried to index on several columns, but no effect.
Please Advice.

推荐答案

请执行以下操作-

sql-server-stored-procedure-optimization
Go through the following-

sql-server-stored-procedure-optimization


这篇关于时间消耗存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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