使用许多内部联接优化存储过程 [英] Optimize stored procedure with many inner joins

查看:63
本文介绍了使用许多内部联接优化存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个存储过程,首先是连续的5个内部连接和接下来的4个左连接



如何优化这个过程,我可以使用临时表而不是连续内部加入,他们会有什么改进



请建议

Got a stored procedure, first with continuous 5 inner joins and next 4 left joins

how to optimize this procedure , can i use temp tables instead of continuous inner join , will their be any improvement

Kindly advise

推荐答案

1)首先使用SQL Profiler和索引调整向导(如果您使用的是MSSQL或其他供应商的类似产品)和优化索引。

2)将您的查询细分为阶段或部分。

3)测试在片段上创建临时表并查看结果。
1) Start by using the SQL Profiler and index tuning wizard (if you are using MSSQL or similar products from other vendors) and optimizing indexes.
2) Break down your query into stages or pieces.
3) Test creating temp tables on the pieces and seeing the results.


这篇关于使用许多内部联接优化存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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