com.mckoi.database
Class QueryPlan.JoinNode

java.lang.Object
  extended by com.mckoi.database.QueryPlan.BranchQueryPlanNode
      extended by com.mckoi.database.QueryPlan.JoinNode
All Implemented Interfaces:
QueryPlanNode, java.io.Serializable, java.lang.Cloneable
Enclosing class:
QueryPlan

public static class QueryPlan.JoinNode
extends QueryPlan.BranchQueryPlanNode

A branch node for a non-equi join between two tables.

NOTE: The cost of a LeftJoin is higher if the right child result is greater than the left child result. The plan should be arranged so smaller results are on the left.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mckoi.database.QueryPlan.BranchQueryPlanNode
left, right
 
Constructor Summary
QueryPlan.JoinNode(QueryPlanNode left, QueryPlanNode right, Variable left_var, Operator join_op, Expression right_expression)
           
 
Method Summary
 java.lang.Object clone()
          Deep clone.
 java.util.ArrayList discoverCorrelatedVariables(int level, java.util.ArrayList list)
          Default implementation that discovers correlated variables for the given offset level.
 java.util.ArrayList discoverTableNames(java.util.ArrayList list)
          Default implementation delegates responsibility to children.
 Table evaluate(QueryContext context)
          Evaluates the node and returns the result as a Table.
 java.lang.String titleString()
           
 
Methods inherited from class com.mckoi.database.QueryPlan.BranchQueryPlanNode
debugString, left, right
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryPlan.JoinNode

public QueryPlan.JoinNode(QueryPlanNode left,
                          QueryPlanNode right,
                          Variable left_var,
                          Operator join_op,
                          Expression right_expression)
Method Detail

evaluate

public Table evaluate(QueryContext context)
Description copied from interface: QueryPlanNode
Evaluates the node and returns the result as a Table. The VariableResolver resolves any outer variables


discoverTableNames

public java.util.ArrayList discoverTableNames(java.util.ArrayList list)
Description copied from class: QueryPlan.BranchQueryPlanNode
Default implementation delegates responsibility to children.

Specified by:
discoverTableNames in interface QueryPlanNode
Overrides:
discoverTableNames in class QueryPlan.BranchQueryPlanNode

discoverCorrelatedVariables

public java.util.ArrayList discoverCorrelatedVariables(int level,
                                                       java.util.ArrayList list)
Description copied from class: QueryPlan.BranchQueryPlanNode
Default implementation that discovers correlated variables for the given offset level.

Specified by:
discoverCorrelatedVariables in interface QueryPlanNode
Overrides:
discoverCorrelatedVariables in class QueryPlan.BranchQueryPlanNode

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: QueryPlan.BranchQueryPlanNode
Deep clone.

Specified by:
clone in interface QueryPlanNode
Overrides:
clone in class QueryPlan.BranchQueryPlanNode
Throws:
java.lang.CloneNotSupportedException

titleString

public java.lang.String titleString()
Overrides:
titleString in class QueryPlan.BranchQueryPlanNode