Internals of Nested-Loop-Join

This document gives the user guide and describes the structure of the Nested-Loop-Join, implemented as nestedLoopJoin function.

User guide

When calling the nestedLoopJoin function, users need to set the key type and payload type. Only one key stream and one payload stream is given for an input table. If multiple key columns or multiple payload columns are required, please use the combineCol to combine columns.

Every left row will become an independent channel to compare with the right table. Users need to set the number of channels by setting the CMP_NUM template parameter. 50 is a typical number for the CMP_NUM.

Caution

Very large CMP_NUM (more than 120) may result in numerous resource.

Users need to push the left and right tables into the associated streams. The number of rows of the left table should not exceed the predefined CMP_NUM. But it can be less than the CMP_NUM. Unused channels will generate an empty table (assert the end of table flag for one cycle) to the next module.

Structure

Nested Loop Join Structure

The following steps will be performed when the nested loop join function is called:

  • Load the left table using shift registers.
  • Pull out right table row by row and compared with the left table.