Hash join: Difference between revisions
Content added Content deleted
(→{{header|Perl 6}}: add entry) |
(clean up verbiage a bit) |
||
Line 2: | Line 2: | ||
The classic [[wp:Hash Join|hash join]] algorithm for an inner join of two relations has the following steps: |
The classic [[wp:Hash Join|hash join]] algorithm for an inner join of two relations has the following steps: |
||
<ul> |
<ul> |
||
<li>Hash phase |
<li>Hash phase: Create a hash table for one of the two relations by applying a hash |
||
function to the join attribute of each row. Ideally we should create a hash table for the |
function to the join attribute of each row. Ideally we should create a hash table for the |
||
smaller relation |
smaller relation, thus optimizing for creation time and memory size of the hash table.</li> |
||
<li>Join phase |
<li>Join phase: Scan the larger relation and find the relevant rows by looking in the |
||
hash table created before.</li> |
hash table created before.</li> |
||
</ul> |
</ul> |
||
Line 21: | Line 21: | ||
'''place''' relation in ''Q'' |
'''place''' relation in ''Q'' |
||
Task: implement the Hash Join algorithm and show the result of joining two tables with it. |
|||
=={{header|Haskell}}== |
=={{header|Haskell}}== |