org.apache.derby.impl.sql.compile
Class CurrentOfNode
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.QueryTreeNode
-
- org.apache.derby.impl.sql.compile.ResultSetNode
-
- org.apache.derby.impl.sql.compile.CurrentOfNode
-
- All Implemented Interfaces:
- Optimizable, Visitable
public final class CurrentOfNode extends ResultSetNode
The CurrentOf operator is used by positioned DELETE and UPDATE to get the current row and location for the target cursor. The bind() operations for positioned DELETE and UPDATE add a column to the select list under the statement for the row location accessible from this node. This node is placed in the from clause of the select generated for the delete or update operation. It acts much like a FromBaseTable, using the information about the target table of the cursor to provide information.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanconsiderSortAvoidancePath()Check whether this optimizable's sort avoidance path should be considered.intconvertAbsoluteToRelativeColumnPosition(int absolutePosition)Convert an absolute to a relative 0-based column position.CostEstimateestimateCost(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.booleanfeasibleJoinStrategy(OptimizablePredicateList predList, Optimizer optimizer)Is the current proposed join strategy for this optimizable feasible given the predicate list?booleanforUpdate()Return true if this is the target table of an updatejava.lang.StringgetBaseTableName()Get the table name of this Optimizable.AccessPathgetBestAccessPath()Get the best access path for this Optimizable.AccessPathgetBestSortAvoidancePath()Get the best sort-avoidance path for this Optimizable.java.lang.StringgetCorrelationName()Get this table's correlation name, if any.AccessPathgetCurrentAccessPath()Get the current access path under consideration for this Optimizablejava.lang.StringgetName()Get the (exposed) name of this OptimizableintgetNumColumnsReturned()Get the number of the number of columns returned by this Optimizable.java.util.PropertiesgetProperties()Get the Properties list, if any, associated with this optimizable.TableDescriptorgetTableDescriptor()Get the table descriptor for this table (if any).intgetTableNumber()Get this Optimizable's table numberAccessPathgetTrulyTheBestAccessPath()Get the best access path overall for this Optimizable.int[]hashKeyColumns()Return the hash key column numbers, for hash join strategybooleanhasLargeObjectColumns()Check if any columns containing large objects (BLOBs or CLOBs) are referenced in this table.booleanhasTableNumber()Return true if this Optimizable has a table numbervoidinitAccessPaths(Optimizer optimizer)Init the access paths for this optimizable.intinitialCapacity()Return the initial capacity of the hash table, for hash join strategybooleanisBaseTable()Tell whether this Optimizable represents a base tablebooleanisCoveringIndex(ConglomerateDescriptor cd)Return whether or not this is a covering index.booleanisMaterializable()Tell whether this Optimizable is materializablebooleanisOneRowScan()Will the optimizable return at most 1 row per scan?booleanisTargetTable()Is the optimizable the target table of an update or delete?booleanlegalJoinOrder(JBitSet assignedTableMap)Can this Optimizable appear at the current location in the join order.floatloadFactor()Return the load factor of the hash table, for hash join strategyintmaxCapacity(JoinStrategy joinStrategy, int maxMemoryPerTable)Return the maximum capacity of the hash table, for hash join strategybooleanmemoryUsageOK(double rowCount, int maxMemoryPerTable)OptimizablemodifyAccessPath(JBitSet outerTables)Modify the access path for this Optimizable, as necessary.booleannextAccessPath(Optimizer optimizer, OptimizablePredicateList predList, RowOrdering rowOrdering)Choose the next access path to evaluate for this Optimizable.CostEstimateoptimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering)Choose the best access path for this Optimizable.voidpullOptPredicates(OptimizablePredicateList optimizablePredicates)Pull all the OptimizablePredicates from this Optimizable and put them in the given OptimizablePredicateList.booleanpushOptPredicate(OptimizablePredicate optimizablePredicate)Push an OptimizablePredicate down, if this node accepts it.voidrememberAsBest(int planType, Optimizer optimizer)Remember the current access path as the best one (so far).voidrememberJoinStrategyAsBest(AccessPath ap)Remember the current join strategy as the best one so far in this join order.voidrememberSortAvoidancePath()Mark this optimizable so that its sort avoidance path will be considered.voidsetHashKeyColumns(int[] columnNumbers)Set the hash key column numbers, for hash join strategyvoidsetProperties(java.util.Properties tableProperties)Set the Properties list for this optimizalbe.voidstartOptimizing(Optimizer optimizer, RowOrdering rowOrdering)Begin the optimization process for this Optimizable.booleansupportsMultipleInstantiations()Tell whether this Optimizable can be instantiated multiple timesjava.lang.StringtoString()Convert this object to a String.doubleuniqueJoin(OptimizablePredicateList predList)Does this optimizable have a uniqueness condition on the given predicate list, and if so, how many unique keys will be returned per scan.voidupdateBestPlanMap(short action, java.lang.Object planKey)When remembering "truly the best" access path for an Optimizable, we have to keep track of which OptimizerImpl the "truly the best" access is for.intupdateTargetLockMode()Get the lock mode for this table as the target of an update statement (a delete or update).voidverifyProperties(DataDictionary dDictionary)Verify that the Properties list with optimizer overrides, if specified, is valid-
Methods inherited from class org.apache.derby.impl.sql.compile.ResultSetNode
getReferencedTableMap, getResultSetNumber, makeResultDescription, parseDefault
-
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, addTag, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, createTypeDependency, getBeginOffset, getDataDictionary, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getUDTDesc, isAtomic, makeConstantAction, makeTableName, makeTableName, optimizerTracingIsOn, orReliability, referencesSessionSchema, setBeginOffset, setEndOffset, taggedWith, treePrint
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable
getDataDictionary, getOptimizerTracer, getReferencedTableMap, getResultSetNumber, optimizerTracingIsOn
-
Methods inherited from interface org.apache.derby.iapi.sql.compile.Visitable
accept, addTag, taggedWith
-
-
-
-
Method Detail
-
estimateCost
public CostEstimate estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException
Description copied from interface:OptimizableEstimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate. It is assumed that the predicate list has already been classified. This cost estimate is just for one scan, not for the life of the query.- Specified by:
estimateCostin interfaceOptimizable- Parameters:
predList- The predicate list to optimize againstcd- The conglomerate descriptor to get the cost ofouterCost- The estimated cost of the part of the plan outer to this optimizable.optimizer- The optimizer to use to help estimate the costrowOrdering- The row ordering for all the tables in the join order, including this one.- Returns:
- The estimated cost of doing the scan
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.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)
-
toString
public java.lang.String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.- Returns:
- This object as a String
-
updateTargetLockMode
public int updateTargetLockMode()
Get the lock mode for this table as the target of an update statement (a delete or update). This is implemented only for base tables and CurrentOfNodes.- Returns:
- The lock mode
- See Also:
TransactionController
-
getCorrelationName
public java.lang.String getCorrelationName()
Get this table's correlation name, if any.
-
optimizeIt
public CostEstimate optimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException
Description copied from interface:OptimizableChoose the best access path for this Optimizable.- Specified by:
optimizeItin interfaceOptimizable- Parameters:
optimizer- Optimizer to use.predList- The predicate list to optimize againstouterCost- The CostEstimate for the outer tables in the join order, telling how many times this Optimizable will be scanned.rowOrdering- The row ordering for all the tables in the join order, including this one.- Returns:
- The optimizer's estimated cost of the best access path.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.optimizeIt(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.RowOrdering)
-
nextAccessPath
public boolean nextAccessPath(Optimizer optimizer, OptimizablePredicateList predList, RowOrdering rowOrdering) throws StandardException
Description copied from interface:OptimizableChoose the next access path to evaluate for this Optimizable.- Specified by:
nextAccessPathin interfaceOptimizable- Parameters:
optimizer- Optimizer to use.predList- The predicate list for this optimizable. The optimizer always passes null, and it is up to the optimizable object to pass along its own predicate list, if appropriate, when delegating this method.rowOrdering- The row ordering for all the outer tables in the join order. This method will add the ordering of the next access path to the given RowOrdering.- Returns:
- true means another access path was chosen, false means no more access paths to evaluate.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.nextAccessPath(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.compile.RowOrdering)
-
getCurrentAccessPath
public AccessPath getCurrentAccessPath()
Description copied from interface:OptimizableGet the current access path under consideration for this Optimizable- Specified by:
getCurrentAccessPathin interfaceOptimizable- See Also:
Optimizable.getCurrentAccessPath()
-
getBestAccessPath
public AccessPath getBestAccessPath()
Description copied from interface:OptimizableGet the best access path for this Optimizable.- Specified by:
getBestAccessPathin interfaceOptimizable- See Also:
Optimizable.getBestAccessPath()
-
getBestSortAvoidancePath
public AccessPath getBestSortAvoidancePath()
Description copied from interface:OptimizableGet the best sort-avoidance path for this Optimizable.- Specified by:
getBestSortAvoidancePathin interfaceOptimizable- See Also:
Optimizable.getBestSortAvoidancePath()
-
getTrulyTheBestAccessPath
public AccessPath getTrulyTheBestAccessPath()
Description copied from interface:OptimizableGet the best access path overall for this Optimizable.- Specified by:
getTrulyTheBestAccessPathin interfaceOptimizable- See Also:
Optimizable.getTrulyTheBestAccessPath()
-
rememberSortAvoidancePath
public void rememberSortAvoidancePath()
Description copied from interface:OptimizableMark this optimizable so that its sort avoidance path will be considered.- Specified by:
rememberSortAvoidancePathin interfaceOptimizable- See Also:
Optimizable.rememberSortAvoidancePath()
-
considerSortAvoidancePath
public boolean considerSortAvoidancePath()
Description copied from interface:OptimizableCheck whether this optimizable's sort avoidance path should be considered.- Specified by:
considerSortAvoidancePathin interfaceOptimizable- See Also:
Optimizable.considerSortAvoidancePath()
-
rememberJoinStrategyAsBest
public void rememberJoinStrategyAsBest(AccessPath ap)
Description copied from interface:OptimizableRemember the current join strategy as the best one so far in this join order.- Specified by:
rememberJoinStrategyAsBestin interfaceOptimizable- See Also:
Optimizable.rememberJoinStrategyAsBest(org.apache.derby.iapi.sql.compile.AccessPath)
-
getTableDescriptor
public TableDescriptor getTableDescriptor()
Description copied from interface:OptimizableGet the table descriptor for this table (if any). Only base tables have table descriptors - for the rest of the optimizables, this method returns null.- Specified by:
getTableDescriptorin interfaceOptimizable- See Also:
Optimizable.getTableDescriptor()
-
pushOptPredicate
public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) throws StandardException
Description copied from interface:OptimizablePush an OptimizablePredicate down, if this node accepts it.- Specified by:
pushOptPredicatein interfaceOptimizable- Parameters:
optimizablePredicate- OptimizablePredicate to push down.- Returns:
- Whether or not the predicate was pushed down.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.pushOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)
-
pullOptPredicates
public void pullOptPredicates(OptimizablePredicateList optimizablePredicates) throws StandardException
Description copied from interface:OptimizablePull all the OptimizablePredicates from this Optimizable and put them in the given OptimizablePredicateList.- Specified by:
pullOptPredicatesin interfaceOptimizable- Parameters:
optimizablePredicates- The list to put the pulled predicates in.- Throws:
StandardException- Thrown on error- See Also:
Optimizable.pullOptPredicates(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
-
modifyAccessPath
public Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
Description copied from interface:OptimizableModify the access path for this Optimizable, as necessary. This includes things like adding a result set to translate from index rows to base rows- Specified by:
modifyAccessPathin interfaceOptimizable- Parameters:
outerTables- Bit map of the tables that are outer to this one in the join order.- Returns:
- The (potentially new) Optimizable at the top of the tree.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)
-
isCoveringIndex
public boolean isCoveringIndex(ConglomerateDescriptor cd) throws StandardException
Description copied from interface:OptimizableReturn whether or not this is a covering index. We expect to call this during generation, after access path selection is complete.- Specified by:
isCoveringIndexin interfaceOptimizable- Parameters:
cd- ConglomerateDesriptor for index to consider- Returns:
- boolean Whether or not this is a covering index.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.isCoveringIndex(org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)
-
getProperties
public java.util.Properties getProperties()
Description copied from interface:OptimizableGet the Properties list, if any, associated with this optimizable.- Specified by:
getPropertiesin interfaceOptimizable- Returns:
- The Properties list, if any, associated with this optimizable.
- See Also:
Optimizable.getProperties()
-
setProperties
public void setProperties(java.util.Properties tableProperties)
Description copied from interface:OptimizableSet the Properties list for this optimizalbe.- Specified by:
setPropertiesin interfaceOptimizable- Parameters:
tableProperties- The Properties list for this optimizable.- See Also:
Optimizable.setProperties(java.util.Properties)
-
verifyProperties
public void verifyProperties(DataDictionary dDictionary) throws StandardException
Description copied from interface:OptimizableVerify that the Properties list with optimizer overrides, if specified, is valid- Specified by:
verifyPropertiesin interfaceOptimizable- Parameters:
dDictionary- The DataDictionary to use.- Throws:
StandardException- Thrown on error- See Also:
Optimizable.verifyProperties(org.apache.derby.iapi.sql.dictionary.DataDictionary)
-
getName
public java.lang.String getName() throws StandardExceptionDescription copied from interface:OptimizableGet the (exposed) name of this Optimizable- Specified by:
getNamein interfaceOptimizable- Returns:
- The name of this Optimizable.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.getName()
-
getBaseTableName
public java.lang.String getBaseTableName()
Description copied from interface:OptimizableGet the table name of this Optimizable. Only base tables have table names (by the time we use this method, all views will have been resolved).- Specified by:
getBaseTableNamein interfaceOptimizable- See Also:
Optimizable.getBaseTableName()
-
convertAbsoluteToRelativeColumnPosition
public int convertAbsoluteToRelativeColumnPosition(int absolutePosition)
Description copied from interface:OptimizableConvert an absolute to a relative 0-based column position. This is useful when generating qualifiers for partial rows from the store.- Specified by:
convertAbsoluteToRelativeColumnPositionin interfaceOptimizable- Parameters:
absolutePosition- The absolute 0-based column position for the column.- Returns:
- The relative 0-based column position for the column.
- See Also:
Optimizable.convertAbsoluteToRelativeColumnPosition(int)
-
updateBestPlanMap
public void updateBestPlanMap(short action, java.lang.Object planKey) throws StandardExceptionDescription copied from interface:OptimizableWhen remembering "truly the best" access path for an Optimizable, we have to keep track of which OptimizerImpl the "truly the best" access is for. In most queries there will only be one OptimizerImpl in question, but in cases where there are nested subqueries, there will be one OptimizerImpl for every level of nesting, and each OptimizerImpl might have its own idea of what this Optimizable's "truly the best path" access path really is. In addition, there could be Optimizables above this Optimizable that might need to override the best path chosen during optimization. So whenever we save a "truly the best" path, we take note of which Optimizer/Optimizable told us to do so. Then as each level of subquery finishes optimization, the corresponding OptimizerImpl/Optimizable can load its preferred access path into this Optimizable's trulyTheBestAccessPath field and pass it up the tree, until eventually the outer-most OptimizerImpl can choose to either use the best path that it received from below (by calling "rememberAsBest()") or else use the path that it found to be "best" for itself. This method is what allows us to keep track of which OptimizerImpl or Optimizable saved which "best plan", and allows us to load the appropriate plans after each round of optimization.- Specified by:
updateBestPlanMapin interfaceOptimizable- Parameters:
action- Indicates whether we're adding, loading, or removing a best plan for the OptimizerImpl/Optimizable.planKey- Object to use as the map key when adding/looking up a plan. If it is an instance of OptimizerImpl then it corresponds to an outer query; otherwise it's some Optimizable above this Optimizable that could potentially reject plans chosen by the OptimizerImpl to which this Optimizable belongs.- Throws:
StandardException- See Also:
Optimizable.updateBestPlanMap(short, java.lang.Object)
-
rememberAsBest
public void rememberAsBest(int planType, Optimizer optimizer) throws StandardExceptionDescription copied from interface:OptimizableRemember the current access path as the best one (so far).- Specified by:
rememberAsBestin interfaceOptimizable- Parameters:
planType- The type of plan (one of Optimizer.NORMAL_PLAN or Optimizer.SORT_AVOIDANCE_PLAN)optimizer- The OptimizerImpl that is telling this Optimizable to remember its current path as "truly the best".- Throws:
StandardException- thrown on error.- See Also:
Optimizable.rememberAsBest(int, org.apache.derby.iapi.sql.compile.Optimizer)
-
startOptimizing
public void startOptimizing(Optimizer optimizer, RowOrdering rowOrdering)
Description copied from interface:OptimizableBegin the optimization process for this Optimizable. This can be called many times for an Optimizable while optimizing a query - it will typically be called every time the Optimizable is placed in a potential join order.- Specified by:
startOptimizingin interfaceOptimizable- See Also:
Optimizable.startOptimizing(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)
-
isBaseTable
public boolean isBaseTable()
Description copied from interface:OptimizableTell whether this Optimizable represents a base table- Specified by:
isBaseTablein interfaceOptimizable- See Also:
Optimizable.isBaseTable()
-
hasLargeObjectColumns
public boolean hasLargeObjectColumns()
Check if any columns containing large objects (BLOBs or CLOBs) are referenced in this table.- Specified by:
hasLargeObjectColumnsin interfaceOptimizable- Returns:
trueif at least one large object column is referenced,falseotherwise
-
isMaterializable
public boolean isMaterializable() throws StandardExceptionDescription copied from interface:OptimizableTell whether this Optimizable is materializable- Specified by:
isMaterializablein interfaceOptimizable- Throws:
StandardException- Thrown on error- See Also:
Optimizable.isMaterializable()
-
supportsMultipleInstantiations
public boolean supportsMultipleInstantiations()
Description copied from interface:OptimizableTell whether this Optimizable can be instantiated multiple times- Specified by:
supportsMultipleInstantiationsin interfaceOptimizable- See Also:
Optimizable.supportsMultipleInstantiations()
-
getTableNumber
public int getTableNumber()
Description copied from interface:OptimizableGet this Optimizable's table number- Specified by:
getTableNumberin interfaceOptimizable- See Also:
Optimizable.getTableNumber()
-
hasTableNumber
public boolean hasTableNumber()
Description copied from interface:OptimizableReturn true if this Optimizable has a table number- Specified by:
hasTableNumberin interfaceOptimizable- See Also:
Optimizable.hasTableNumber()
-
forUpdate
public boolean forUpdate()
Description copied from interface:OptimizableReturn true if this is the target table of an update- Specified by:
forUpdatein interfaceOptimizable- See Also:
Optimizable.forUpdate()
-
initialCapacity
public int initialCapacity()
Description copied from interface:OptimizableReturn the initial capacity of the hash table, for hash join strategy- Specified by:
initialCapacityin interfaceOptimizable- See Also:
Optimizable.initialCapacity()
-
loadFactor
public float loadFactor()
Description copied from interface:OptimizableReturn the load factor of the hash table, for hash join strategy- Specified by:
loadFactorin interfaceOptimizable- See Also:
Optimizable.loadFactor()
-
maxCapacity
public int maxCapacity(JoinStrategy joinStrategy, int maxMemoryPerTable) throws StandardException
Description copied from interface:OptimizableReturn the maximum capacity of the hash table, for hash join strategy- Specified by:
maxCapacityin interfaceOptimizablemaxMemoryPerTable- The maximum number of bytes to be used. Ignored if the user has set a maximum number of rows for the Optimizable.- Throws:
StandardException- Standard error policy- See Also:
Optimizable.maxCapacity(org.apache.derby.iapi.sql.compile.JoinStrategy, int)
-
hashKeyColumns
public int[] hashKeyColumns()
Description copied from interface:OptimizableReturn the hash key column numbers, for hash join strategy- Specified by:
hashKeyColumnsin interfaceOptimizable- See Also:
Optimizable.hashKeyColumns()
-
setHashKeyColumns
public void setHashKeyColumns(int[] columnNumbers)
Description copied from interface:OptimizableSet the hash key column numbers, for hash join strategy- Specified by:
setHashKeyColumnsin interfaceOptimizable- See Also:
Optimizable.setHashKeyColumns(int[])
-
feasibleJoinStrategy
public boolean feasibleJoinStrategy(OptimizablePredicateList predList, Optimizer optimizer) throws StandardException
Description copied from interface:OptimizableIs the current proposed join strategy for this optimizable feasible given the predicate list?- Specified by:
feasibleJoinStrategyin interfaceOptimizable- Parameters:
predList- The predicate list that has been pushed down to this optimizableoptimizer- The optimizer to use.- Returns:
- true means feasible
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.feasibleJoinStrategy(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.compile.Optimizer)
-
memoryUsageOK
public boolean memoryUsageOK(double rowCount, int maxMemoryPerTable) throws StandardException- Specified by:
memoryUsageOKin interfaceOptimizable- Returns:
- true if the memory usage of the proposed access path is OK, false if not.
- Throws:
StandardException- standard error policy- See Also:
Optimizable.memoryUsageOK(double, int)
-
legalJoinOrder
public boolean legalJoinOrder(JBitSet assignedTableMap)
Description copied from interface:OptimizableCan this Optimizable appear at the current location in the join order. In other words, have the Optimizable's dependencies been satisfied?- Specified by:
legalJoinOrderin interfaceOptimizable- Parameters:
assignedTableMap- The tables that have been placed so far in the join order.- Returns:
- Where or not this Optimizable can appear at the current location in the join order.
- See Also:
Optimizable.legalJoinOrder(org.apache.derby.iapi.util.JBitSet)
-
getNumColumnsReturned
public int getNumColumnsReturned()
Description copied from interface:OptimizableGet the number of the number of columns returned by this Optimizable.- Specified by:
getNumColumnsReturnedin interfaceOptimizable- Returns:
- The number of the number of columns returned by this Optimizable.
- See Also:
Optimizable.getNumColumnsReturned()
-
isTargetTable
public boolean isTargetTable()
Description copied from interface:OptimizableIs the optimizable the target table of an update or delete?- Specified by:
isTargetTablein interfaceOptimizable- Returns:
- Whether or not the optimizable the target table of an update or delete.
- See Also:
Optimizable.isTargetTable()
-
isOneRowScan
public boolean isOneRowScan() throws StandardExceptionDescription copied from interface:OptimizableWill the optimizable return at most 1 row per scan?- Specified by:
isOneRowScanin interfaceOptimizable- Returns:
- Whether or not the optimizable will return at most 1 row per scan?
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.isOneRowScan()
-
initAccessPaths
public void initAccessPaths(Optimizer optimizer)
Description copied from interface:OptimizableInit the access paths for this optimizable.- Specified by:
initAccessPathsin interfaceOptimizable- Parameters:
optimizer- The optimizer being used.- See Also:
Optimizable.initAccessPaths(org.apache.derby.iapi.sql.compile.Optimizer)
-
uniqueJoin
public double uniqueJoin(OptimizablePredicateList predList) throws StandardException
Description copied from interface:OptimizableDoes this optimizable have a uniqueness condition on the given predicate list, and if so, how many unique keys will be returned per scan.- Specified by:
uniqueJoinin interfaceOptimizable- Parameters:
predList- The predicate list to check- Returns:
- <= 0 means there is no uniqueness condition > 0 means there is a uniqueness condition, and the return value is the number of rows per scan.
- Throws:
StandardException- Thrown on error- See Also:
Optimizable.uniqueJoin(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG