首页 > 其他 > 详细

关联查询之速度优化

时间:2017-04-06 17:03:13      阅读:249      评论:0      收藏:0      [点我收藏+]

在有些关联表的数据比较多的情况,可以先筛选出一部分临时表。然后用临时表关联。优化速度从15s提升到3s

形式如

select * into #tempTable1 from Table1 where CurrentVersion_SID=@temp_versionID select * into #tempTable2 from Table2 where CurrentVersion_SID=@temp_versionID select * into #tempTable3 from Table3 where CurrentVersion_SID=@temp_versionID select * into #tempTable4 from Table4 where CurrentVersion_SID=@temp_versionID select * into #tempTable5 from Table5 where CurrentVersion_SID=@temp_versionID

中间各种关联查询

DROP TABLE #tempTable1 DROP TABLE #tempTable2 drop table #tempTable3 drop table #tempTable4 drop table #tempTable5 drop table #tempTable6 drop table #tempTable7

关联查询之速度优化

原文:http://www.cnblogs.com/yanshaoxiong/p/6674297.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!