花时间运行存储过程时出现问题 [英] Problem in taking time to run a stored procedure

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

问题描述



我有一个表,其中包含12400437个记录,我想按国家/地区和年龄来获取按性别划分的记录数.运行该存储过程大约需要38秒.请告诉我以其他方式在更短的时间内获取记录的方法.

Hi,

I have a table contains 12400437 records, I want get the count of records by Gender-Male and female by country wise and age. It was taking 38 secs to run that stored procedure.Please tell me the any other way to fetch the records in less time..

推荐答案

Laxman,

我有以下检查清单.它将帮助您减少激发查询的时间.

1)检查表上的索引.
2)主要是SP不需要花费更多的32个级别来尝试从sp(存储过程)中减少条件的级别.


您可以执行的另一项最佳操作(在.net中)
喜欢像
这样的异步数据处理
BeginExicuteNonQuery
EndExicuteNonQuery



问候
迪帕克
Hi Laxman,

I have following check list.it will help you to reduce the timing to exicute the query.

1)Check the indexes on the table.
2)Main thing is SP does''t take more then 32 level try to reduce the levels of conditions from the sp(stored procedures)


Another Best thing you can do(In .net)
prefer the Asyncronous data processing like

BeginExicuteNonQuery
EndExicuteNonQuery

Etc

Regards
Deepak


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

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