| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | HalfOuterJoinNode(ResultSetNode
The ResultSetNode on the left side of this join leftResult, ResultSetNode The ResultSetNode on the right side of this join rightResult, ValueNode The ON clause onClause, ResultColumnList The USING clause usingClause, boolean Whether or not this node represents a user
specified right outer join rightOuterJoin, Properties Properties list associated with the table tableProperties, ContextManager The context manager cm)Constructor for a HalfOuterJoinNode. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | addOuterJoinArguments(ActivationClassBuilder
The ActivationClassBuilder acb, MethodBuilder the method the generate code is to go into
return The args that have been added mb)Overrides org. Generate and add any arguments specifict to outer joins. |
| protected void | adjustNumberOfRowsReturned(CostEstimate costEstimate)
Overrides org. Some types of joins (e.g. outer joins) will return a different number of rows than is predicted by optimizeIt() in JoinNode. |
| pack-priv void | generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built acb, MethodBuilder The method for the generated code to go into mb)Overrides org. Generate the code for an inner join node. |
| pack-priv ResultSetNode | getLogicalLeftResultSet()
Overrides org. Return the logical left result set for this qualified join node. |
| pack-priv ResultSetNode | getLogicalRightResultSet()
Overrides org. Return the logical right result set for this qualified join node. |
| protected int | getNumJoinArguments()
Overrides org. Return the number of arguments to the join result set. |
| pack-priv void | isJoinColumnForRightOuterJoin(ResultColumn rc)
Overrides org. If this is a right outer join node with USING/NATURAL clause, then check if the passed ResultColumn is a join column. |
| private boolean | Returns: true if thejoinClause has at least one relop that
references both leftTableMap and rightTableMapThe join clause (i.e. predicate) we want to check joinClause, JBitSet a bit map representing the tables expected for the
predicate (logical left) leftTableMap, JBitSet a bit map representing the tables expected for the
predicate (logical right) rightTableMap)Tests pRiRj in the sense of Galindo-Legaria et al: Outerjoin Simplification and Reordering for Query Optimization, ACM Transactions on Database Systems, Vol. 22, No.</quote> |
| pack-priv boolean | isRightOuterJoin()
Return true if right outer join or false if left outer join Used to set Nullability correctly in JoinNode |
| pack-priv boolean | |
| pack-priv boolean | Returns: boolean true if any reordering took place at this level or deeper so caller can know whether rebinding may be necessarynumber of tables involved (needed to right size the
bitmaps) numTables)Overrides org. This method recursively:
|
| pack-priv JBitSet | |
| public JBitSet | |
| pack-priv void | |
| pack-priv ResultSetNode | Returns: The generated ProjectRestrictNode atop the original FromTable.Number of tables in the DML Statement numTables, GroupByList The group by list, if any gbl, FromList The from list, if any fromList)Overrides org. Put a ProjectRestrictNode on top of each FromTable in the FromList. |
| pack-priv void | pushExpressions(PredicateList
The PredicateList from the outer RS. outerPredicateList)Overrides org. Push expressions down to the first ResultSetNode which can do expression evaluation and has the same referenced table map. |
| public boolean | pushOptPredicate(OptimizablePredicate
OptimizablePredicate to push down. optimizablePredicate)Overrides org. Implements org. Push an OptimizablePredicate down, if this node accepts it. |
| public String | Returns: This object as a StringOverrides org. Convert this object to a String. |
| pack-priv FromTable | Returns: The new tree top (OuterJoin or InnerJoin).The predicate tree for the query block predicateTree, int numTables)Overrides org. Transform any Outer Join into an Inner Join where applicable. |
| rightOuterJoin | back to summary |
|---|---|
| private boolean rightOuterJoin | |
| transformed | back to summary |
|---|---|
| private boolean transformed | |
| HalfOuterJoinNode | back to summary |
|---|---|
| pack-priv HalfOuterJoinNode(ResultSetNode leftResult, ResultSetNode rightResult, ValueNode onClause, ResultColumnList usingClause, boolean rightOuterJoin, Properties tableProperties, ContextManager cm) throws StandardException Constructor for a HalfOuterJoinNode.
| |
| addOuterJoinArguments | back to summary |
|---|---|
| pack-priv int addOuterJoinArguments(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException Overrides org. Generate and add any arguments specifict to outer joins. Generate the methods (and add them as parameters) for returning an empty row from 1 or more sides of an outer join, if required. Pass whether or not this was originally a right outer join.
| |
| adjustNumberOfRowsReturned | back to summary |
|---|---|
| protected void adjustNumberOfRowsReturned(CostEstimate costEstimate) Overrides org. Doc from org. Some types of joins (e.g. outer joins) will return a different number of rows than is predicted by optimizeIt() in JoinNode. So, adjust this value now. This method does nothing for most join types.
| |
| generate | back to summary |
|---|---|
| pack-priv void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException Overrides org. Generate the code for an inner join node.
| |
| getLogicalLeftResultSet | back to summary |
|---|---|
| pack-priv ResultSetNode getLogicalLeftResultSet() Overrides org. Return the logical left result set for this qualified join node. (For RIGHT OUTER JOIN, the left is the right and the right is the left and the JOIN is the NIOJ).
| |
| getLogicalRightResultSet | back to summary |
|---|---|
| pack-priv ResultSetNode getLogicalRightResultSet() Overrides org. Return the logical right result set for this qualified join node. (For RIGHT OUTER JOIN, the left is the right and the right is the left and the JOIN is the NIOJ).
| |
| getNumJoinArguments | back to summary |
|---|---|
| protected int getNumJoinArguments() Overrides org. Return the number of arguments to the join result set.
| |
| isJoinColumnForRightOuterJoin | back to summary |
|---|---|
| pack-priv void isJoinColumnForRightOuterJoin(ResultColumn rc) Overrides org. If this is a right outer join node with USING/NATURAL clause, then check if the passed ResultColumn is a join column. If yes, then ResultColumn should be marked such. DERBY-4631
| |
| isNullRejecting | back to summary |
|---|---|
| private boolean isNullRejecting(ValueNode joinClause, JBitSet leftTableMap, JBitSet rightTableMap) throws StandardException Tests pRiRj in the sense of Galindo-Legaria et al: Outerjoin
Simplification and Reordering for Query Optimization, ACM
Transactions on Database Systems, Vol. 22, No. 1, March 1997, Pages
43-74:
To simplify analysis, we only accept predicates of the form: X relop Y [and .. and X-n relop Y-n]At least one of the relops should reference both leftTableMap
and rightTableMap, so that we know that sch(p) includes
attributes of both Ri, Rj. I.e.
or
| |
| isRightOuterJoin | back to summary |
|---|---|
| pack-priv boolean isRightOuterJoin() Return true if right outer join or false if left outer join Used to set Nullability correctly in JoinNode | |
| LOJ_bindResultColumns | back to summary |
|---|---|
| pack-priv boolean LOJ_bindResultColumns(boolean anyChange) throws StandardException | |
| LOJ_reorderable | back to summary |
|---|---|
| pack-priv boolean LOJ_reorderable(int numTables) throws StandardException Overrides org. This method recursively:
OJ1 pT1T2 OJ1 pT2T3
/ \ / \
/ \ can / t3
t1 OJ2 pT2T3 reorder /
/ \ to OJ2 pT1T2
/ \ / \
t2 t3 / \
t1 t2
where pR1R2 is a null-rejecting predicate which references the schema
of joinee R1 and R2, cf. terminology explanation in #isNullRejecting.
The join predicates are assumed to be in CNF form. Note: Present implementation limitations
| |
| LOJgetNPReferencedTables | back to summary |
|---|---|
| pack-priv JBitSet LOJgetNPReferencedTables(int numTables) throws StandardException | |
| LOJgetRPReferencedTables | back to summary |
|---|---|
| public JBitSet LOJgetRPReferencedTables(int numTables) throws StandardException | |
| oneRowRightSide | back to summary |
|---|---|
| pack-priv void oneRowRightSide(ActivationClassBuilder acb, MethodBuilder mb) Overrides org.
| |
| preprocess | back to summary |
|---|---|
| pack-priv ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException Overrides org. Put a ProjectRestrictNode on top of each FromTable in the FromList. ColumnReferences must continue to point to the same ResultColumn, so that ResultColumn must percolate up to the new PRN. However, that ResultColumn will point to a new expression, a VirtualColumnNode, which points to the FromTable and the ResultColumn that is the source for the ColumnReference. (The new PRN will have the original of the ResultColumnList and the ResultColumns from that list. The FromTable will get shallow copies of the ResultColumnList and its ResultColumns. ResultColumn.expression will remain at the FromTable, with the PRN getting a new VirtualColumnNode for each ResultColumn.expression.) We then project out the non-referenced columns. If there are no referenced columns, then the PRN's ResultColumnList will consist of a single ResultColumn whose expression is 1.
| |
| pushExpressions | back to summary |
|---|---|
| pack-priv void pushExpressions(PredicateList outerPredicateList) throws StandardException Overrides org. Push expressions down to the first ResultSetNode which can do expression evaluation and has the same referenced table map. RESOLVE - This means only pushing down single table expressions to DistinctNodes today. Once we have a better understanding of how the optimizer will work, we can push down join clauses.
| |
| pushOptPredicate | back to summary |
|---|---|
| public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) throws StandardException Overrides org. Implements org. Doc from org. Push an OptimizablePredicate down, if this node accepts it.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing. | |
| transformOuterJoins | back to summary |
|---|---|
| pack-priv FromTable transformOuterJoins(ValueNode predicateTree, int numTables) throws StandardException Overrides org. Transform any Outer Join into an Inner Join where applicable. (Based on the existence of a null intolerant predicate on the inner table.)
| |