Join Operators
A join operator node has two or three operands:
For a cross join, these are the only operands permitted. For all the other join types, a third operand is required:
The value of the Operand Datatype property of the Query Operand Description of operands 0 and 1 of join operators is DMA_DATATYPE_CLASS .
For cross joins, the Cartesian product is produced. For all other join operators, the searchable class or subordinate join expression from operand 0 is joined to the searchable class of operand 1 via the Boolean expression subtree whose root is operand 2.
It is not required that a Join Operator be supported between all possible pairs of searchable classes in the document space.
The well known join operators defined by DMA do not join objects from different document spaces. When a join operation is actually performed, it is performed by a single document space between searchable classes in its metadata. Undefined parts of the From Expression must be eliminated by the rules of three valued elimination. If three valued elimination is needed but is not available, the query fails with a query construction error. For the well known join operators specified by DMA, the results of evaluating a join in a merged scope is the union of the results of evaluating the join in its component scopes.
Joins and Three Valued Elimination
In the following tables, operand 0 is undefined if it is a searchable class node which specifies an undefined class, or if it is a join operator node which evaluates to undefined by recursive application of these rules.
Operand 1 is "Undefined" if it is a searchable class node which specifies an undefined class.
Operand 2 is "Undefined" if it specifies an operator which is undefined, or if it evaluates to "Undefined" because of "Undefined" operands.
An outcome of "Undefined" for the root node of the From Expression results in the query returning zero rows.
Cross Join
Op 0 |
Op 1 |
Outcome |
Defined |
Undefined |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Defined |
Inner Join
Op 0 |
Op 1 |
Op 2 |
Outcome |
Defined |
Defined |
Undefined |
Undefined |
Defined |
Undefined |
Defined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Defined |
Defined |
Left Outer Join
Op 0 |
Op 1 |
Op 2 |
Outcome |
Defined |
Defined |
Undefined |
Undefined |
Defined |
Undefined |
Defined |
Defined (result is Op 0) |
Defined |
Undefined |
Undefined |
Defined (result is Op 0) |
Undefined |
Defined |
Defined |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Defined |
Defined |
Right Outer Join
Op 0 |
Op 1 |
Op 2 |
Outcome |
Defined |
Defined |
Undefined |
Undefined |
Defined |
Undefined |
Defined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Defined (result is Op 1) |
Undefined |
Defined |
Undefined |
Defined (result is Op 1) |
Undefined |
Undefined |
Defined |
Undefined |
Undefined |
Undefined |
Undefined |
Undefined |
Defined |
Defined |
Defined |
Defined |
The following Join Operators are defined: