Top Description Inners Constructors Methods
org.apache.derby.iapi.sql.compile

public abstract Class OptimizerPlan

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.iapi.sql.compile.OptimizerPlan.Join, org.apache.derby.iapi.sql.compile.OptimizerPlan.DeadEnd, org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource
Imports
org.apache.derby.catalog.AliasInfo, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.StatementUtil, org.apache.derby.iapi.sql.compile.CompilerContext, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.AliasDescriptor, .ConglomerateDescriptor, .DataDictionary, .SchemaDescriptor, .UniqueTupleDescriptor, org.apache.derby.iapi.util.IdUtil

High level description of a plan for consideration by the Optimizer. This is used to specify a complete plan via optimizer overrides. A plan is a tree whose interior nodes are join operators and whose leaves are row sources (conglomerates or tableFunctions).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
OptimizerPlan.DeadEnd

Generic plan for row sources we don't understand

public static class
public abstract static class
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Bind the conglomerate and table function names in this plan.

public abstract int
countLeafNodes()

Count the number of leaf nodes under (and including) this node.

public abstract boolean
isBound()

Return true if this the schema and RowSource names have been resolved.

public abstract boolean
isLeftPrefixOf(OptimizerPlan that)

Return true if this plan is a (left) leading prefix of the other plan.

public abstract OptimizerPlan
leftmostLeaf()

Get the leftmost leaf node in this plan.

public static OptimizerPlan.RowSource<D extends UniqueTupleDescriptor>
makeRowSource(UniqueTupleDescriptor utd, DataDictionary dd)

Make a RowSource corresponding to the given tuple descriptor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

OptimizerPlanback to summary
public OptimizerPlan()

Method Detail

bindback to summary
public abstract void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

countLeafNodesback to summary
public abstract int countLeafNodes()

Count the number of leaf nodes under (and including) this node.

isBoundback to summary
public abstract boolean isBound()

Return true if this the schema and RowSource names have been resolved.

isLeftPrefixOfback to summary
public abstract boolean isLeftPrefixOf(OptimizerPlan that)

Return true if this plan is a (left) leading prefix of the other plan.

leftmostLeafback to summary
public abstract OptimizerPlan leftmostLeaf()

Get the leftmost leaf node in this plan.

makeRowSourceback to summary
public static OptimizerPlan.RowSource<D extends UniqueTupleDescriptor> makeRowSource(UniqueTupleDescriptor utd, DataDictionary dd) throws StandardException

Make a RowSource corresponding to the given tuple descriptor.

org.apache.derby.iapi.sql.compile back to summary

public final Class OptimizerPlan.ConglomerateRS

extends OptimizerPlan.RowSource<ConglomerateDescriptor>
Class Inheritance

Field Summary

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource:
_descriptor_rowSourceName_schema_schemaName

Constructor Summary

AccessConstructor and Description
public
ConglomerateRS(String schemaName, String rowSourceName)

public

Method Summary

Modifier and TypeMethod and Description
public void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.bind.

Bind the conglomerate and table function names in this plan.

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource:
countLeafNodesequalsgetDescriptorisBoundisLeftPrefixOfleftmostLeaftoString

Constructor Detail

ConglomerateRSback to summary
public ConglomerateRS(String schemaName, String rowSourceName)
ConglomerateRSback to summary
public ConglomerateRS(ConglomerateDescriptor cd, DataDictionary dataDictionary) throws StandardException

Method Detail

bindback to summary
public void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.bind.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

org.apache.derby.iapi.sql.compile back to summary

public Class OptimizerPlan.DeadEnd

extends OptimizerPlan
Class Inheritance

Generic plan for row sources we don't understand

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

public int
countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

public boolean
isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

public boolean
isLeftPrefixOf(OptimizerPlan that)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

public OptimizerPlan
leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan:
makeRowSource

Field Detail

_nameback to summary
private String _name

Constructor Detail

DeadEndback to summary
public DeadEnd(String name)

Method Detail

bindback to summary
public void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

countLeafNodesback to summary
public int countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

isBoundback to summary
public boolean isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

isLeftPrefixOfback to summary
public boolean isLeftPrefixOf(OptimizerPlan that)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

leftmostLeafback to summary
public OptimizerPlan leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

org.apache.derby.iapi.sql.compile back to summary

public final Class OptimizerPlan.Join

extends OptimizerPlan
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private int
pack-priv final OptimizerPlan
pack-priv final OptimizerPlan
pack-priv final JoinStrategy

Constructor Summary

AccessConstructor and Description
public
Join(JoinStrategy strategy, OptimizerPlan leftChild, OptimizerPlan rightChild)

Method Summary

Modifier and TypeMethod and Description
public void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

public int
countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public boolean
isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

public boolean
isLeftPrefixOf(OptimizerPlan other)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

public OptimizerPlan
leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan:
makeRowSource

Field Detail

_isBoundback to summary
private boolean _isBound
_leafNodeCountback to summary
private int _leafNodeCount
leftChildback to summary
pack-priv final OptimizerPlan leftChild
rightChildback to summary
pack-priv final OptimizerPlan rightChild
strategyback to summary
pack-priv final JoinStrategy strategy

Constructor Detail

Joinback to summary
public Join(JoinStrategy strategy, OptimizerPlan leftChild, OptimizerPlan rightChild)

Method Detail

bindback to summary
public void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

countLeafNodesback to summary
public int countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

isBoundback to summary
public boolean isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

isLeftPrefixOfback to summary
public boolean isLeftPrefixOf(OptimizerPlan other)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

leftmostLeafback to summary
public OptimizerPlan leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

org.apache.derby.iapi.sql.compile back to summary

public abstract Class OptimizerPlan.RowSource<D extends UniqueTupleDescriptor>

extends OptimizerPlan
Class Inheritance
Known Direct Subclasses
org.apache.derby.iapi.sql.compile.OptimizerPlan.ConglomerateRS, org.apache.derby.iapi.sql.compile.OptimizerPlan.TableFunctionRS

Field Summary

Modifier and TypeField and Description
protected D
protected String
protected SchemaDescriptor
protected String

Constructor Summary

AccessConstructor and Description
public
RowSource(String schemaName, String rowSourceName)

protected

Method Summary

Modifier and TypeMethod and Description
public void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

public int
countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public D
getDescriptor()

Get the UniqueTupleDescriptor bound to this RowSource

public boolean
isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

public boolean
isLeftPrefixOf(OptimizerPlan that)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

public OptimizerPlan
leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan:
makeRowSource

Field Detail

_descriptorback to summary
protected D _descriptor
_rowSourceNameback to summary
protected String _rowSourceName
_schemaback to summary
protected SchemaDescriptor _schema
_schemaNameback to summary
protected String _schemaName

Constructor Detail

RowSourceback to summary
public RowSource(String schemaName, String rowSourceName)
RowSourceback to summary
protected RowSource()

Method Detail

bindback to summary
public void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

countLeafNodesback to summary
public int countLeafNodes()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.countLeafNodes.

Count the number of leaf nodes under (and including) this node.

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getDescriptorback to summary
public D getDescriptor()

Get the UniqueTupleDescriptor bound to this RowSource

isBoundback to summary
public boolean isBound()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isBound.

Return true if this the schema and RowSource names have been resolved.

isLeftPrefixOfback to summary
public boolean isLeftPrefixOf(OptimizerPlan that)

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.isLeftPrefixOf.

Return true if this plan is a (left) leading prefix of the other plan.

leftmostLeafback to summary
public OptimizerPlan leftmostLeaf()

Implements abstract org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.leftmostLeaf.

Get the leftmost leaf node in this plan.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

org.apache.derby.iapi.sql.compile back to summary

public final Class OptimizerPlan.TableFunctionRS

extends OptimizerPlan.RowSource<AliasDescriptor>
Class Inheritance

Field Summary

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource:
_descriptor_rowSourceName_schema_schemaName

Constructor Summary

AccessConstructor and Description
public
TableFunctionRS(String schemaName, String rowSourceName)

public

Method Summary

Modifier and TypeMethod and Description
public void
bind(DataDictionary
DataDictionary to bind against.
dataDictionary
,
LanguageConnectionContext lcc, CompilerContext cc)

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.bind.

Bind the conglomerate and table function names in this plan.

public String
toString()

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource:
countLeafNodesequalsgetDescriptorisBoundisLeftPrefixOfleftmostLeaf

Constructor Detail

TableFunctionRSback to summary
public TableFunctionRS(String schemaName, String rowSourceName)
TableFunctionRSback to summary
public TableFunctionRS(AliasDescriptor ad)

Method Detail

bindback to summary
public void bind(DataDictionary dataDictionary, LanguageConnectionContext lcc, CompilerContext cc) throws StandardException

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.bind.

Doc from org.apache.derby.iapi.sql.compile.OptimizerPlan.bind.

Bind the conglomerate and table function names in this plan.

Parameters
dataDictionary:DataDictionary

DataDictionary to bind against.

toStringback to summary
public String toString()

Overrides org.apache.derby.iapi.sql.compile.OptimizerPlan.RowSource.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object