2010-12-08 9 views

答えて

2

マージ結合では不可能です。 Merge Join algorithmは、2つのソート済み入力セットを使用しており、次のように処理されます。

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 
       return (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 

入力セットが

input 1      input 2 
------      ------ 
    1       7 
    2       8 
    3       9 

た場合、インクルードはinput2.value > input1.valueは9行(すべての順列)を返します参加。しかし、上記のアルゴリズムでは各セットを1回通過することはできません。

関連する問題