Reference Guide > TDV Query Engine Options > JOIN Options > SEMIJOIN (JOIN Option)
 
SEMIJOIN (JOIN Option)
SEMIJOIN causes the optimizer to try to perform a semijoin optimization. If SEMIJOIN is not specified, the optimizer decides whether to apply semijoin optimization.
Note: Semijoin is an Information Integration tool. It is a fast algorithm that reduces the number of rows retrieved from the right-hand side (RHS). It rewrites the FETCH pushed to the second data source. For this it uses selective criteria provided by the unique values returned from an initial query on the left-hand side (LHS). In a semijoin, LHS is evaluated and loaded into a table in memory, and its cardinality is evaluated. If the cardinality is small enough, an IN clause or an OR expression is created containing all the values in the join criteria from LHS. The clause or expression is then appended to the WHERE clause on RHS and pushed to the database. In this way, only rows with matches are retrieved from RHS.
The semijoin can only be attempted if the RHS can be queried as a single node that fetches against a data source that supports an IN clause or an OR expression.
Operator
JOIN
Syntax
semijoin
Example
SELECT column1 FROM table1 INNER {OPTION semijoin} JOIN table2 ON table1.id = table2.id