如何提高存储过程的性能 [英] How to Increase Stored Procedure Performance
本文介绍了如何提高存储过程的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在单个表中有超过3000000个记录,所以我的sql查询需要1分钟。
如何增加存储过程性能
I have greater than 3000000 records in single table so my sql querys taking 1 minutes .
how to Increase Stored Procedure Performance
推荐答案
按照以下链接获取最佳实践以增加存储过程的性能:
http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-优化提示 - 最佳实践/ [ ^ ]
使用SQL事件探查器捕获慢速运行的查询并重新调解它:
SQL Server Profiler Step by Step [ ^ ]
https://www.simple-talk.com/sql/performance/how-to-identify -slow-running-queries-with-sql-profiler / [ ^ ]
其次如果你加入大桌子然后创建一个非聚集索引,该列用于加入查询。
Follow below link for best practice to increase Stored Procedure performance:
http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/[^]
Use SQL Profiler to catch your slow running queries and re-mediate it:
SQL Server Profiler Step by Step[^]
https://www.simple-talk.com/sql/performance/how-to-identify-slow-running-queries-with-sql-profiler/[^]
Secondly if you are joining with large table then create a non-clustered index which column is used in joining query.
这篇关于如何提高存储过程的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文