|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.FromVTI
A FromVTI represents a VTI in the FROM list of a DML statement.
Field Summary | |
private FormatableHashtable |
compileTimeConstants
|
private boolean |
controlsDeferral
|
(package private) JBitSet |
correlationMap
|
(package private) JBitSet |
dependencyMap
|
private boolean |
emptyForUpdate
Was the FOR UPDATE clause empty (no columns specified). |
(package private) double |
estimatedCost
|
(package private) double |
estimatedRowCount
|
(package private) TableName |
exposedName
|
private boolean |
forUpdatePresent
Was a FOR UPDATE clause specified in a SELECT statement. |
private boolean |
implementsPushable
|
(package private) boolean |
implementsVTICosting
|
private boolean |
isInsensitive
|
(package private) boolean |
isTarget
|
(package private) boolean |
materializable
|
private JavaValueNode[] |
methodParms
|
(package private) NewInvocationNode |
newInvocation
|
protected int |
numVTICols
|
(package private) boolean |
optimized
|
private java.sql.PreparedStatement |
ps
|
private PredicateList |
restrictionList
|
private int |
resultSetType
|
(package private) java.sql.ResultSet |
rs
|
(package private) SubqueryList |
subqueryList
|
(package private) boolean |
supportsMultipleInstantiations
|
protected boolean |
version2
|
(package private) boolean |
vtiCosted
|
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, loadFactor, maxCapacity, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
costEstimate, cursorTargetTable, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
Constructor Summary | |
FromVTI()
|
Method Summary | |
Visitable |
accept(Visitor v)
Accept a visitor, and call v.visit() on child nodes as necessary. |
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this VTI. |
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind the non VTI tables in this ResultSetNode. |
ResultSetNode |
bindVTITables(FromList fromListParam)
Bind this VTI that appears in the FROM list. |
CostEstimate |
estimateCost(OptimizablePredicateList predList,
ConglomerateDescriptor cd,
CostEstimate outerCost,
Optimizer optimizer,
RowOrdering rowOrdering)
Estimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Generation on a FromVTI creates a wrapper around the user's java.sql.ResultSet |
private void |
generateConstructor(ActivationClassBuilder acb,
MethodBuilder mb,
boolean reuseablePs)
|
protected ResultSetNode |
genProjectRestrict(int numTables)
Put a ProjectRestrictNode on top of each FromTable in the FromList. |
private ResultColumnList |
genResultColList(TableDescriptor td)
|
ResultColumnList |
getAllResultColumns(TableName allTableName)
Expand a "*" into a ResultColumnList with all of the result columns from the subquery. |
DeferModification |
getDeferralControl()
Get the DeferModification interface associated with this VTI |
java.lang.String |
getExposedName()
Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query. |
TableName |
getExposedTableName()
|
private int[] |
getForUpdateColumnList()
|
ResultColumn |
getMatchingColumn(ColumnReference columnReference)
Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference. |
private java.lang.Object |
getNewInstance()
|
NewInvocationNode |
getNewInvocation()
Return the new invocation from this node. |
(package private) java.util.Vector |
getNodesFromParameters(java.lang.Class nodeClass)
Get all of the nodes of the specified class from the parameters to this VTI. |
java.lang.String |
getOriginalSQL()
Return the SQL text of the original SQL statement. |
java.sql.ResultSetMetaData |
getResultSetMetaData()
Get the ResultSetMetaData for the class/object. |
int |
getResultSetType()
|
private int |
getScanArguments(ActivationClassBuilder acb,
MethodBuilder mb)
|
java.lang.Object |
getSharedState(java.lang.String key)
Get an an object associated with a key from set of objects maintained with the statement plan. |
private UUID |
getSpecialTriggerVTITableName(LanguageConnectionContext lcc,
java.lang.String className)
Check and see if we have a special trigger VTI. |
int |
getStatementIsolationLevel()
Get the specific JDBC isolation of the statement. |
(package private) java.lang.String |
getVTIName()
|
void |
init(java.lang.Object newInvocation,
java.lang.Object correlationName,
java.lang.Object derivedRCL,
java.lang.Object tableProperties)
Initialize a query tree node. |
void |
init(java.lang.Object newInvocation,
java.lang.Object correlationName,
java.lang.Object derivedRCL,
java.lang.Object tableProperties,
java.lang.Object exposedTableName)
Initialize a query tree node. |
boolean |
isCompileTime()
Return true if this instance of the VTI has been created for compilation, false if it is for runtime execution. |
boolean |
isMaterializable()
Tell whether this Optimizable is materializable |
(package private) boolean |
isUpdatableCursor()
|
boolean |
legalJoinOrder(JBitSet assignedTableMap)
Can this Optimizable appear at the current location in the join order. |
protected void |
markUpdatableByCursor(java.util.Vector updateColumns)
Mark as updatable all the columns in the result column list of this FromBaseTable that match the columns in the given update column list. |
Optimizable |
modifyAccessPath(JBitSet outerTables)
Modify the access path for this Optimizable, as necessary. |
boolean |
needsSpecialRCLBinding()
|
boolean |
performMaterialization(JBitSet outerTables)
Return whether or not to materialize this ResultSet tree. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
boolean |
pushOptPredicate(OptimizablePredicate optimizablePredicate)
Push an OptimizablePredicate down, if this node accepts it. |
boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name. |
void |
setSharedState(java.lang.String key,
java.io.Serializable value)
Saves an object associated with a key that will be maintained for the lifetime of the statement plan. |
(package private) void |
setTarget()
Mark this VTI as the target of a delete or update. |
boolean |
supportsMultipleInstantiations()
Tell whether this Optimizable can be instantiated multiple times |
java.lang.String |
toString()
Convert this object to a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable |
getDataDictionary, getReferencedTableMap, getResultSetNumber |
Field Detail |
JBitSet correlationMap
JBitSet dependencyMap
NewInvocationNode newInvocation
TableName exposedName
SubqueryList subqueryList
boolean implementsVTICosting
boolean optimized
boolean materializable
boolean isTarget
java.sql.ResultSet rs
private FormatableHashtable compileTimeConstants
protected int numVTICols
private PredicateList restrictionList
private boolean forUpdatePresent
private boolean emptyForUpdate
double estimatedCost
double estimatedRowCount
boolean supportsMultipleInstantiations
boolean vtiCosted
protected boolean version2
private boolean implementsPushable
private java.sql.PreparedStatement ps
private JavaValueNode[] methodParms
private boolean controlsDeferral
private boolean isInsensitive
private int resultSetType
Constructor Detail |
public FromVTI()
Method Detail |
public void init(java.lang.Object newInvocation, java.lang.Object correlationName, java.lang.Object derivedRCL, java.lang.Object tableProperties) throws StandardException
QueryTreeNode
init
in class QueryTreeNode
newInvocation
- The constructor for the VTIcorrelationName
- The correlation namederivedRCL
- The derived column listtableProperties
- Properties list associated with the table
StandardException
- Thrown on errorpublic void init(java.lang.Object newInvocation, java.lang.Object correlationName, java.lang.Object derivedRCL, java.lang.Object tableProperties, java.lang.Object exposedTableName) throws StandardException
QueryTreeNode
init
in class QueryTreeNode
newInvocation
- The constructor for the VTIcorrelationName
- The correlation namederivedRCL
- The derived column listtableProperties
- Properties list associated with the tableexposedTableName
- The table name (TableName class)
StandardException
- Thrown on errorpublic CostEstimate estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException
Optimizable
estimateCost
in interface Optimizable
estimateCost
in class FromTable
StandardException
- Thrown on errorOptimizable.estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)
public boolean legalJoinOrder(JBitSet assignedTableMap)
Optimizable
legalJoinOrder
in interface Optimizable
legalJoinOrder
in class FromTable
Optimizable.legalJoinOrder(org.apache.derby.iapi.util.JBitSet)
public boolean isMaterializable()
Optimizable
isMaterializable
in interface Optimizable
isMaterializable
in class FromTable
Optimizable.isMaterializable()
public boolean supportsMultipleInstantiations()
Optimizable
supportsMultipleInstantiations
in interface Optimizable
supportsMultipleInstantiations
in class FromTable
Optimizable.supportsMultipleInstantiations()
public Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
Optimizable
modifyAccessPath
in interface Optimizable
modifyAccessPath
in class FromTable
StandardException
- Thrown on errorOptimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)
public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) throws StandardException
Optimizable
pushOptPredicate
in interface Optimizable
pushOptPredicate
in class FromTable
StandardException
- Thrown on errorOptimizable.pushOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)
public java.lang.String toString()
toString
in class FromTable
public void printSubNodes(int depth)
printSubNodes
in class ResultSetNode
depth
- The depth of this node in the tree
public NewInvocationNode getNewInvocation()
public java.lang.String getExposedName()
getExposedName
in class FromTable
public TableName getExposedTableName()
void setTarget()
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
bindNonVTITables
in class ResultSetNode
dataDictionary
- The DataDictionary to use for bindingfromListParam
- FromList to use/append to.
StandardException
- Thrown on errorjava.lang.String getVTIName()
public ResultSetNode bindVTITables(FromList fromListParam) throws StandardException
bindVTITables
in class ResultSetNode
fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic java.sql.ResultSetMetaData getResultSetMetaData() throws StandardException
StandardException
- Thrown on errorprivate java.lang.Object getNewInstance() throws StandardException
StandardException
public DeferModification getDeferralControl() throws StandardException
StandardException
public int getResultSetType()
public void bindExpressions(FromList fromListParam) throws StandardException
bindExpressions
in class ResultSetNode
fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorjava.util.Vector getNodesFromParameters(java.lang.Class nodeClass) throws StandardException
nodeClass
- The Class of interest.
StandardException
- Thrown on errorpublic ResultColumnList getAllResultColumns(TableName allTableName) throws StandardException
getAllResultColumns
in class ResultSetNode
allTableName
- The qualifier on the "*"
StandardException
- Thrown on errorpublic ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException
getMatchingColumn
in class ResultSetNode
columnReference
- The columnReference whose name we're looking
for in the given table.
StandardException
- Thrown on errorpublic ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class ResultSetNode
numTables
- The number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if any
StandardException
- Thrown on errorprotected ResultSetNode genProjectRestrict(int numTables) throws StandardException
genProjectRestrict
in class ResultSetNode
numTables
- Number of tables in the DML Statement
StandardException
- Thrown on errorpublic boolean performMaterialization(JBitSet outerTables) throws StandardException
performMaterialization
in class ResultSetNode
StandardException
- Thrown on errorpublic void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The MethodBuilder for the execute() method to be built
StandardException
- Thrown on errorprivate int getScanArguments(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
private void generateConstructor(ActivationClassBuilder acb, MethodBuilder mb, boolean reuseablePs) throws StandardException
StandardException
public boolean referencesTarget(java.lang.String name, boolean baseTable) throws StandardException
referencesTarget
in class ResultSetNode
name
- Table name (String) to search for.baseTable
- Whether or not name is for a base table
StandardException
- Thrown on errorpublic Visitable accept(Visitor v) throws StandardException
accept
in interface Visitable
accept
in class ResultSetNode
v
- the visitor
StandardException
- on errorprivate UUID getSpecialTriggerVTITableName(LanguageConnectionContext lcc, java.lang.String className) throws StandardException
StandardException
private ResultColumnList genResultColList(TableDescriptor td) throws StandardException
StandardException
public boolean needsSpecialRCLBinding()
needsSpecialRCLBinding
in class FromTable
boolean isUpdatableCursor() throws StandardException
StandardException
protected void markUpdatableByCursor(java.util.Vector updateColumns)
FromTable
markUpdatableByCursor
in class FromTable
updateColumns
- A Vector representing the columns
that can be updated.private int[] getForUpdateColumnList()
public final boolean isCompileTime()
VTIEnvironment
isCompileTime
in interface VTIEnvironment
public java.lang.String getOriginalSQL()
VTIEnvironment
getOriginalSQL
in interface VTIEnvironment
public final int getStatementIsolationLevel()
VTIEnvironment
getStatementIsolationLevel
in interface VTIEnvironment
public void setSharedState(java.lang.String key, java.io.Serializable value)
VTIEnvironment
setSharedState
in interface VTIEnvironment
public java.lang.Object getSharedState(java.lang.String key)
VTIEnvironment
getSharedState
in interface VTIEnvironment
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |