Merge Join与Hash Join的区别

ChinaITOldMan 2013-07-05 11:12:59
麻烦大家以实例讲下SQL Server中Merge Join与Hash Join(hash match)的区别,谢谢!
...全文
583 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
發糞塗牆 2013-07-09
  • 打赏
  • 举报
回复
引用 9 楼 mcxhh2005 的回复:
Merge Join是用于中型表,Hash Join是用于大型表吗?
hash “主要”用在没有索引、没有排序的大表关联,并且在内存中排序。Merge的特点是已排序或者对已排序的的表进行关联。
最爱午夜 2013-07-09
  • 打赏
  • 举报
回复
看看散列函数吧,这个里面有你想要的答案。
ChinaITOldMan 2013-07-09
  • 打赏
  • 举报
回复
thank everyone!
ChinaITOldMan 2013-07-08
  • 打赏
  • 举报
回复
Merge Join是用于中型表,Hash Join是用于大型表吗?
menggang9801 2013-07-08
  • 打赏
  • 举报
回复
一个是用于中型表,一个是用于大型表
ChinaITOldMan 2013-07-06
  • 打赏
  • 举报
回复
谢谢各位,尤其是SQL_beginner
ChinaITOldMan 2013-07-06
  • 打赏
  • 举报
回复
因为觉得概念太抽象,不容易懂,所想大家能否结合实际例子讲讲,谢谢
KevinLiu 2013-07-06
  • 打赏
  • 举报
回复
概念性的问题查一下msdn就有了
longai123 2013-07-06
  • 打赏
  • 举报
回复
好烦啊...........
  • 打赏
  • 举报
回复
很简单,算法不同。 merge join : get first row R1 from input 1 get first row R2 from input 2 while not at the end of either input begin if R1 joins with R2 begin output (R1, R2) get next row R2 from input 2 end else if R1 < R2 get next row R1 from input 1 else get next row R2 from input 2 end Hash join : for each row R1 in the build table begin calculate hash value on R1 join key(s) insert R1 into the appropriate hash bucket end for each row R2 in the probe table begin calculate hash value on R2 join key(s) for each row R1 in the corresponding hash bucket if R1 joins with R2 output (R1, R2) end references: Inside Microsoft SQL Server 2005 Query Tuning and Optimization Hash joins and hash teams in Microsoft SQL Server http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.114.3183&rep=rep1&type=pdf
中国风 2013-07-05
  • 打赏
  • 举报
回复
最好不要强制提示,通常会影响性能,只在链接服务器表时有用过这提示 在联机帮助上都书面说明
叶子 2013-07-05
  • 打赏
  • 举报
回复
这个我也不知道要怎么解释: 1.Merge Join 2.Hash Join

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧