|
最初由 caoliwei 发布
[B]but another question is been asked
how the hash table are organised [/B]
不知道你具体想问什么
举个简单的例子
table T1: column A values: A, B , C
table T2: column B values:A, E, F , C , M....
有查询
select T2.B from T1,T2 where T1.A=T2.B
Hash join下选择table A来建立hash table
hash函数Fn(x) = i
Fn(A)=1
Fn(B)=2
Fn(C)=3
所以依照table T1建立的hash table里面就有1,2,3三个值
这时读取table T2中的数据,经过同样的hash函数Fn(x)=i运算
Fn(A)=1命中
Fn(E)=5不能命中
Fn(F)=6不能命中
Fn(C)=3命中
..... |
|