存储过程的性能改进 [英] Performance Improvement of stored procedure

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

问题描述

大家好,

我有一个存储过程.我有大约1万条记录,我想全部选择.
我没有任何条件?如何提高存储过程的性能?

请帮帮我.

谢谢,
Sushil

Hi All,

I have one stored procedure. I have around 10K records I want to select all of them.
I dont have any where condition? How should I improve performance of the stored procedure?

Please help me.

thanks,
Sushil

推荐答案

好,那么您应该注意一些问题,例如
1.如果查询涉及多个表,请在表上应用主键和索引
2. SET NOCOUNT ON(您可以在MSDN上找到更多详细信息)
3.避免使用函数(如果使用).它将大大提高性能.
4. NO LOCK用于优化表访问
5.避免使用临时表(
) 6.使用最少的JOINS(根据需要)并检查是否使用了正确的JOIN
Ok, then you should take care of some points like
1. Apply primary key and index on tables if more than 1 table is involve in the query
2. SET NOCOUNT ON ( You can find more details on MSDN)
3. Avoid functions if used. It will greatly increase performance.
4. NO LOCK to optimize table access
5. Avoid temporary tables if used
6. Use minimum JOINS(as required) and check whether proper JOIN is used or not


没有人能为您提供确切的解决方案.您必须检查并尝试适合您的方式.
http://www.google.com/search?q=Performance%20tuning%20stored%20procedure [ ^ ]
http://www.sqlservercentral.com/articles/Performance+Tuning/performancetuningstoredprocedures/2505/ [ ^ ]
No one can give you exact solution. You have to check and try what suits you.
http://www.google.com/search?q=Performance%20tuning%20stored%20procedure[^]
http://www.sqlservercentral.com/articles/Performance+Tuning/performancetuningstoredprocedures/2505/[^]


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

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