|
|||||||||
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.FromBaseTable
public class FromBaseTable
A FromBaseTable represents a table in the FROM list of a DML statement, as distinguished from a FromSubquery, which represents a subquery in the FROM list. A FromBaseTable may actually represent a view. During parsing, we can't distinguish views from base tables. During binding, when we find FromBaseTables that represent views, we replace them with FromSubqueries. By the time we get to code generation, all FromSubqueries have been eliminated, and all FromBaseTables will represent only true base tables.
Positioned Update: Currently, all columns of an updatable cursor are selected to deal with a positioned update. This is because we don't know what columns will ultimately be needed from the UpdateNode above us. For example, consider:
get c as 'select cint from t for update of ctinyint' update t set ctinyint = csmallintIdeally, the cursor only selects cint. Then, something akin to an IndexRowToBaseRow is generated to take the CursorResultSet and get the appropriate columns out of the base table from the RowLocation retunrned by the cursor. Then the update node can generate the appropriate NormalizeResultSet (or whatever else it might need) to get things into the correct format for the UpdateResultSet. See CurrentOfNode for more information.
Field Summary | |
---|---|
(package private) ConglomerateDescriptor |
baseConglomerateDescriptor
|
(package private) PredicateList |
baseTableRestrictionList
Restriction as a PredicateList |
(package private) int |
bulkFetch
|
(package private) boolean |
bulkFetchTurnedOff
|
private java.lang.String[] |
columnNames
|
(package private) ConglomerateDescriptor[] |
conglomDescs
|
static int |
DELETE
|
private JBitSet |
dependencyMap
|
private boolean |
distinctScan
|
private boolean |
existsBaseTable
|
private int[] |
fkColArray
|
private long |
fkIndexConglomId
|
private boolean |
getUpdateLocks
|
private boolean |
gotRowCount
|
private boolean |
isNotExists
|
(package private) boolean |
multiProbing
|
(package private) PredicateList |
nonBaseTableRestrictionList
|
(package private) PredicateList |
nonStoreRestrictionList
|
private boolean |
raDependentScan
Information for dependent table scan for Referential Actions |
private java.lang.String |
raParentResultSetId
|
private FormatableBitSet |
referencedCols
|
(package private) PredicateList |
requalificationRestrictionList
|
(package private) PredicateList |
restrictionList
|
private long |
rowCount
|
private double |
singleScanRowCount
|
private boolean |
specialMaxScan
|
(package private) PredicateList |
storeRestrictionList
|
(package private) TableDescriptor |
tableDescriptor
|
(package private) TableName |
tableName
|
private ResultColumnList |
templateColumns
|
(package private) static int |
UNSET
|
static int |
UPDATE
|
(package private) int |
updateOrDelete
|
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
---|
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
---|
costEstimate, cursorTargetTable, finalCostEstimate, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
Constructor Summary | |
---|---|
FromBaseTable()
|
Method Summary | |
---|---|
(package private) void |
acceptChildren(Visitor v)
Accept the visitor for all visitable children of this node. |
ResultColumnList |
addColsToList(ResultColumnList inputRcl,
FormatableBitSet colsWeWant)
Augment the RCL to include the columns in the FormatableBitSet. |
(package private) void |
adjustForSortElimination()
Notify the underlying result set tree that the optimizer has chosen to "eliminate" a sort. |
(package private) void |
adjustForSortElimination(RequiredRowOrdering rowOrdering)
Same goal as adjustForSortElimination above, but this version takes a RequiredRowOrdering to allow nodes to adjust based on the ORDER BY clause, if needed. |
private long |
baseRowCount()
|
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this FromBaseTable. |
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind the table in this FromBaseTable. |
void |
bindResultColumns(FromList fromListParam)
Bind the result columns of this ResultSetNode when there is no base table to bind them to. |
private TableDescriptor |
bindTableDescriptor()
Bind the table descriptor for this table. |
protected boolean |
canBeOrdered()
Tell super-class that this Optimizable can be ordered |
ResultSetNode |
changeAccessPath()
The optimizer's decision on the access path for a result set may require the generation of extra result sets. |
(package private) void |
clearDependency(java.util.Vector locations)
Clear the bits from the dependency map when join nodes are flattened |
int |
convertAbsoluteToRelativeColumnPosition(int absolutePosition)
Convert an absolute to a relative 0-based column position. |
protected boolean |
cursorTargetTable()
Is this a table that has a FOR UPDATE clause? |
(package private) void |
disableBulkFetch()
Turn off bulk fetch |
(package private) void |
doSpecialMaxScan()
Do a special scan for max. |
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. |
boolean |
forUpdate()
Return true if this is the target table of an update |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Generation on a FromBaseTable creates a scan on the optimizer-selected conglomerate. |
private void |
generateDistinctScan(ExpressionClassBuilder acb,
MethodBuilder mb)
|
private void |
generateMaxSpecialResultSet(ExpressionClassBuilder acb,
MethodBuilder mb)
|
private void |
generateRefActionDependentTableScan(ExpressionClassBuilder acb,
MethodBuilder mb)
Generation on a FromBaseTable for a referential action dependent table. |
void |
generateResultSet(ExpressionClassBuilder acb,
MethodBuilder mb)
Generation on a FromBaseTable for a SELECT. |
protected ResultSetNode |
genProjectRestrict(int numTables)
Put a ProjectRestrictNode on top of each FromTable in the FromList. |
ResultColumnList |
genResultColList()
Build a ResultColumnList based on all of the columns in this FromBaseTable. |
ResultColumnList |
getAllResultColumns(TableName allTableName)
Return a ResultColumnList with all of the columns in this table. |
private StoreCostController |
getBaseCostController()
|
java.lang.String |
getBaseTableName()
Get the table name of this Optimizable. |
private void |
getConglomDescs()
|
private int |
getDefaultBulkFetch()
|
(package private) boolean |
getExistsBaseTable()
Does this FBT represent an EXISTS FBT. |
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. |
private TableName |
getExposedTableName()
Get the exposed table name for this table, which is the name that can be used to refer to it in the rest of the query. |
CostEstimate |
getFinalCostEstimate()
Get the final CostEstimate for this ResultSetNode. |
private ConglomerateDescriptor |
getFirstConglom()
|
protected FromTable |
getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
Determine whether or not the specified name is an exposed name in the current query block. |
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 ConglomerateDescriptor |
getNextConglom(ConglomerateDescriptor currCD)
|
private DataValueDescriptor[] |
getRowTemplate(ConglomerateDescriptor cd,
StoreCostController scc)
|
private int |
getScanArguments(ExpressionClassBuilder acb,
MethodBuilder mb)
|
private StoreCostController |
getStoreCostController(ConglomerateDescriptor cd)
|
TableDescriptor |
getTableDescriptor()
Get the table descriptor for this table (if any). |
TableName |
getTableName()
Return a TableName node representing this FromTable. |
TableName |
getTableNameField()
Return the table name for this table. |
private java.lang.String |
getUserSpecifiedIndexName()
|
void |
init(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4)
Initializer for a table in a FROM list. |
int |
initialCapacity()
Return the initial capacity of the hash table, for hash join strategy |
boolean |
isBaseTable()
Tell whether this Optimizable represents a base table |
boolean |
isCoveringIndex(ConglomerateDescriptor cd)
Return whether or not this is a covering index. |
boolean |
isMaterializable()
Tell whether this Optimizable is materializable |
boolean |
isNotExists()
Return whether or not this is actually a EBT for NOT EXISTS. |
boolean |
isOneRowResultSet()
Return whether or not the underlying ResultSet tree will return a single row, at most. |
private boolean |
isOneRowResultSet(ConglomerateDescriptor cd,
OptimizablePredicateList predList)
Is this a one-row result set with the given conglomerate descriptor? |
boolean |
isOneRowResultSet(OptimizablePredicateList predList)
|
boolean |
isOneRowScan()
Will the optimizable return at most 1 row per scan? |
private boolean |
isOrdered(ColumnReference[] crs,
ConglomerateDescriptor cd)
Return whether or not this index is ordered on a permutation of the specified columns. |
(package private) boolean |
isOrderedOn(ColumnReference[] crs,
boolean permuteOrdering,
java.util.Vector fbtVector)
Return whether or not the underlying ResultSet tree is ordered on the specified columns. |
(package private) boolean |
isPossibleDistinctScan(java.util.Set distinctColumns)
Is it possible to do a distinct scan on this ResultSet tree. |
private boolean |
isStrictlyOrdered(ColumnReference[] crs,
ConglomerateDescriptor cd)
Return whether or not this index is ordered on a permutation of the specified columns. |
boolean |
isTargetTable()
Is the optimizable the target table of an update or delete? |
boolean |
legalJoinOrder(JBitSet assignedTableMap)
Can this Optimizable appear at the current location in the join order. |
float |
loadFactor()
Return the load factor of the hash table, for hash join strategy |
boolean |
LOJ_reorderable(int numTables)
no LOJ reordering for base table. |
JBitSet |
LOJgetReferencedTables(int numTables)
|
private int |
mapAbsoluteToRelativeColumnPosition(int absolutePosition)
Convert an absolute to a relative 0-based column position. |
boolean |
markAsCursorTargetTable()
Mark this ResultSetNode as the target table of an updatable cursor. |
(package private) void |
markForDistinctScan()
Mark the underlying scan as a distinct scan. |
(package private) void |
markUpdated(ResultColumnList 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. |
boolean |
memoryUsageOK(double rowCount,
int maxMemoryPerTable)
|
private ResultColumnList |
newResultColumns(ResultColumnList oldColumns,
ConglomerateDescriptor idxCD,
ConglomerateDescriptor heapCD,
boolean cloneRCs)
Create a new ResultColumnList to reflect the columns in the index described by the given ConglomerateDescriptor. |
boolean |
nextAccessPath(Optimizer optimizer,
OptimizablePredicateList predList,
RowOrdering rowOrdering)
Choose the next access path to evaluate for this Optimizable. |
CostEstimate |
optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
Choose the best access path for this Optimizable. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. |
void |
pullOptPredicates(OptimizablePredicateList optimizablePredicates)
Pull all the OptimizablePredicates from this Optimizable and put them in the given OptimizablePredicateList. |
private void |
pushIndexName(ConglomerateDescriptor cd,
MethodBuilder mb)
|
boolean |
pushOptPredicate(OptimizablePredicate optimizablePredicate)
Push an OptimizablePredicate down, if this node accepts it. |
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent) |
boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name. |
private double |
scanCostAfterSelectivity(double originalScanCost,
double initialPositionCost,
double selectivity,
boolean anotherIndexUnique)
|
(package private) void |
setExistsBaseTable(boolean existsBaseTable,
JBitSet dependencyMap,
boolean isNotExists)
Set whether or not this FBT represents an EXISTS FBT. |
private void |
setLockingBasedOnThreshold(Optimizer optimizer,
double rowsTouched)
|
void |
setRefActionInfo(long fkIndexConglomId,
int[] fkColArray,
java.lang.String parentResultSetId,
boolean dependentScan)
set the Information gathered from the parent table that is required to peform a referential action on dependent table. |
void |
setTableProperties(java.util.Properties tableProperties)
Set the table properties for this table. |
void |
startOptimizing(Optimizer optimizer,
RowOrdering rowOrdering)
Begin the optimization process for this Optimizable. |
protected boolean |
supersetOfUniqueIndex(boolean[] eqCols)
Determine whether or not the columns marked as true in the passed in array are a superset of any unique index on this table. |
protected boolean |
supersetOfUniqueIndex(JBitSet[] tableColMap)
Determine whether or not the columns marked as true in the passed in join table matrix are a superset of any single column unique index on this table. |
java.lang.String |
toString()
Convert this object to a String. |
double |
uniqueJoin(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. |
int |
updateTargetLockMode()
Get the lock mode for the target table heap of an update or delete statement. |
void |
verifyProperties(DataDictionary dDictionary)
Verify that the Properties list with optimizer overrides, if specified, is valid |
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 |
---|
static final int UNSET
TableName tableName
TableDescriptor tableDescriptor
ConglomerateDescriptor baseConglomerateDescriptor
ConglomerateDescriptor[] conglomDescs
int updateOrDelete
int bulkFetch
boolean bulkFetchTurnedOff
boolean multiProbing
private double singleScanRowCount
private FormatableBitSet referencedCols
private ResultColumnList templateColumns
private java.lang.String[] columnNames
private boolean specialMaxScan
private boolean distinctScan
private boolean raDependentScan
private java.lang.String raParentResultSetId
private long fkIndexConglomId
private int[] fkColArray
PredicateList baseTableRestrictionList
PredicateList nonBaseTableRestrictionList
PredicateList restrictionList
PredicateList storeRestrictionList
PredicateList nonStoreRestrictionList
PredicateList requalificationRestrictionList
public static final int UPDATE
public static final int DELETE
private boolean existsBaseTable
private boolean isNotExists
private JBitSet dependencyMap
private boolean getUpdateLocks
private boolean gotRowCount
private long rowCount
Constructor Detail |
---|
public FromBaseTable()
Method Detail |
---|
public void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
- OR -
init
in class QueryTreeNode
public boolean LOJ_reorderable(int numTables) throws StandardException
LOJ_reorderable
in class FromTable
StandardException
public JBitSet LOJgetReferencedTables(int numTables) throws StandardException
LOJgetReferencedTables
in class ResultSetNode
StandardException
public boolean nextAccessPath(Optimizer optimizer, OptimizablePredicateList predList, RowOrdering rowOrdering) throws StandardException
Optimizable
nextAccessPath
in interface Optimizable
nextAccessPath
in class FromTable
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.
StandardException
- Thrown on errorOptimizable.nextAccessPath(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.compile.RowOrdering)
protected boolean canBeOrdered()
canBeOrdered
in class FromTable
public CostEstimate optimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException
Optimizable
optimizeIt
in interface Optimizable
optimizeIt
in class FromTable
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.
StandardException
- Thrown on errorOptimizable.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)
public TableDescriptor getTableDescriptor()
Optimizable
getTableDescriptor
in interface Optimizable
getTableDescriptor
in class FromTable
Optimizable.getTableDescriptor()
public boolean isMaterializable() throws StandardException
Optimizable
isMaterializable
in interface Optimizable
isMaterializable
in class FromTable
StandardException
- Thrown on errorOptimizable.isMaterializable()
public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate) throws StandardException
Optimizable
pushOptPredicate
in interface Optimizable
pushOptPredicate
in class FromTable
optimizablePredicate
- OptimizablePredicate to push down.
StandardException
- Thrown on errorOptimizable.pushOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)
public void pullOptPredicates(OptimizablePredicateList optimizablePredicates) throws StandardException
Optimizable
pullOptPredicates
in interface Optimizable
pullOptPredicates
in class FromTable
optimizablePredicates
- The list to put the pulled predicates
in.
StandardException
- Thrown on errorOptimizable.pullOptPredicates(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
public boolean isCoveringIndex(ConglomerateDescriptor cd) throws StandardException
Optimizable
isCoveringIndex
in interface Optimizable
isCoveringIndex
in class FromTable
cd
- ConglomerateDesriptor for index to consider
StandardException
- Thrown on errorOptimizable.isCoveringIndex(org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)
public void verifyProperties(DataDictionary dDictionary) throws StandardException
Optimizable
verifyProperties
in interface Optimizable
verifyProperties
in class FromTable
dDictionary
- The DataDictionary to use.
StandardException
- Thrown on errorOptimizable.verifyProperties(org.apache.derby.iapi.sql.dictionary.DataDictionary)
public java.lang.String getBaseTableName()
Optimizable
getBaseTableName
in interface Optimizable
getBaseTableName
in class FromTable
Optimizable.getBaseTableName()
public void startOptimizing(Optimizer optimizer, RowOrdering rowOrdering)
Optimizable
startOptimizing
in interface Optimizable
startOptimizing
in class FromTable
Optimizable.startOptimizing(org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)
public int convertAbsoluteToRelativeColumnPosition(int absolutePosition)
Optimizable
convertAbsoluteToRelativeColumnPosition
in interface Optimizable
convertAbsoluteToRelativeColumnPosition
in class FromTable
absolutePosition
- The absolute 0-based column position for the column.
Optimizable.convertAbsoluteToRelativeColumnPosition(int)
public CostEstimate estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException
Optimizable
estimateCost
in interface Optimizable
estimateCost
in class FromTable
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.
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)
private double scanCostAfterSelectivity(double originalScanCost, double initialPositionCost, double selectivity, boolean anotherIndexUnique) throws StandardException
StandardException
private void setLockingBasedOnThreshold(Optimizer optimizer, double rowsTouched)
public boolean isBaseTable()
Optimizable
isBaseTable
in interface Optimizable
isBaseTable
in class FromTable
Optimizable.isBaseTable()
public boolean forUpdate()
Optimizable
forUpdate
in interface Optimizable
forUpdate
in class FromTable
Optimizable.forUpdate()
public int initialCapacity()
Optimizable
initialCapacity
in interface Optimizable
initialCapacity
in class FromTable
Optimizable.initialCapacity()
public float loadFactor()
Optimizable
loadFactor
in interface Optimizable
loadFactor
in class FromTable
Optimizable.loadFactor()
public boolean memoryUsageOK(double rowCount, int maxMemoryPerTable) throws StandardException
memoryUsageOK
in interface Optimizable
memoryUsageOK
in class FromTable
StandardException
- standard error policyOptimizable.memoryUsageOK(double, int)
public boolean isTargetTable()
Optimizable
isTargetTable
in interface Optimizable
isTargetTable
in class FromTable
Optimizable.isTargetTable()
public double uniqueJoin(OptimizablePredicateList predList) throws StandardException
Optimizable
uniqueJoin
in interface Optimizable
uniqueJoin
in class FromTable
predList
- The predicate list to check
StandardException
- Thrown on errorOptimizable.uniqueJoin(org.apache.derby.iapi.sql.compile.OptimizablePredicateList)
public boolean isOneRowScan() throws StandardException
Optimizable
isOneRowScan
in interface Optimizable
isOneRowScan
in class FromTable
StandardException
- Thrown on errorOptimizable.isOneRowScan()
public boolean legalJoinOrder(JBitSet assignedTableMap)
Optimizable
legalJoinOrder
in interface Optimizable
legalJoinOrder
in class FromTable
assignedTableMap
- The tables that have been placed so far in the join order.
Optimizable.legalJoinOrder(org.apache.derby.iapi.util.JBitSet)
public java.lang.String toString()
toString
in class FromTable
boolean getExistsBaseTable()
void setExistsBaseTable(boolean existsBaseTable, JBitSet dependencyMap, boolean isNotExists)
existsBaseTable
- Whether or not an EXISTS FBT.dependencyMap
- The dependency map for the EXISTS FBT.isNotExists
- Whether or not for NOT EXISTS, more specifically.void clearDependency(java.util.Vector locations)
locations
- vector of bit numbers to be clearedpublic void setTableProperties(java.util.Properties tableProperties)
tableProperties
- The new table properties.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 errorprotected FromTable getFromTableByName(java.lang.String name, java.lang.String schemaName, boolean exactMatch) throws StandardException
getFromTableByName
in class FromTable
name
- The specified name to search for as an exposed name.schemaName
- Schema name, if non-null.exactMatch
- Whether or not we need an exact match on specified schema and table
names or match on table id.
StandardException
- Thrown on errorprivate TableDescriptor bindTableDescriptor() throws StandardException
StandardException
- Thrown on errorpublic void bindExpressions(FromList fromListParam) throws StandardException
bindExpressions
in class ResultSetNode
fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic void bindResultColumns(FromList fromListParam) throws StandardException
bindResultColumns
in class ResultSetNode
fromListParam
- FromList to use/append to.
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 ResultSetNode changeAccessPath() throws StandardException
ResultSetNode
changeAccessPath
in class ResultSetNode
StandardException
- Thrown on errorResultSetNode.changeAccessPath()
private ResultColumnList newResultColumns(ResultColumnList oldColumns, ConglomerateDescriptor idxCD, ConglomerateDescriptor heapCD, boolean cloneRCs) throws StandardException
oldColumns
- The original list of columns, which reflects
the columns in the base table.idxCD
- The ConglomerateDescriptor, which describes
the index that the new ResultColumnList will
reflect.heapCD
- The ConglomerateDescriptor for the base heapcloneRCs
- Whether or not to clone the RCs
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 execute() method to be built
StandardException
- Thrown on errorpublic void generateResultSet(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateResultSet
in class ResultSetNode
acb
- The ExpressionClassBuilder for the class being builtmb
- The execute() method to be built
StandardException
- Thrown on errorpublic CostEstimate getFinalCostEstimate()
getFinalCostEstimate
in class FromTable
private void pushIndexName(ConglomerateDescriptor cd, MethodBuilder mb) throws StandardException
StandardException
private void generateMaxSpecialResultSet(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
private void generateDistinctScan(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
private void generateRefActionDependentTableScan(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
acb
- The ExpressionClassBuilder for the class being builtmb
- The execute() method to be built
StandardException
- Thrown on errorprivate int getScanArguments(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
private int mapAbsoluteToRelativeColumnPosition(int absolutePosition)
absolutePosition
- The absolute 0-based column position.
public java.lang.String getExposedName()
getExposedName
in class FromTable
private TableName getExposedTableName() throws StandardException
StandardException
- Thrown on errorpublic TableName getTableNameField()
public ResultColumnList getAllResultColumns(TableName allTableName) throws StandardException
getAllResultColumns
in class ResultSetNode
allTableName
- The qualifier on the "*"
StandardException
- Thrown on errorpublic ResultColumnList genResultColList() throws StandardException
StandardException
- Thrown on errorpublic ResultColumnList addColsToList(ResultColumnList inputRcl, FormatableBitSet colsWeWant) throws StandardException
inputRcl
- The original listcolsWeWant
- bit set of cols we want
StandardException
- Thrown on errorpublic TableName getTableName() throws StandardException
getTableName
in class FromTable
StandardException
- Thrown on errorpublic boolean markAsCursorTargetTable()
markAsCursorTargetTable
in class ResultSetNode
protected boolean cursorTargetTable()
cursorTargetTable
in class FromTable
void markUpdated(ResultColumnList updateColumns)
updateColumns
- A ResultColumnList representing the columns
to be updated.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 boolean referencesSessionSchema() throws StandardException
referencesSessionSchema
in class QueryTreeNode
StandardException
- Thrown on errorpublic boolean isOneRowResultSet() throws StandardException
isOneRowResultSet
in class ResultSetNode
StandardException
- Thrown on errorpublic boolean isNotExists()
isNotExists
in class ResultSetNode
public boolean isOneRowResultSet(OptimizablePredicateList predList) throws StandardException
StandardException
protected boolean supersetOfUniqueIndex(boolean[] eqCols) throws StandardException
eqCols
- The columns to consider
StandardException
protected boolean supersetOfUniqueIndex(JBitSet[] tableColMap) throws StandardException
tableColMap
- The columns to consider
StandardException
public int updateTargetLockMode()
updateTargetLockMode
in class ResultSetNode
TransactionController
boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, java.util.Vector fbtVector) throws StandardException
isOrderedOn
in class ResultSetNode
crs
- The specified ColumnReference[]permuteOrdering
- Whether or not the order of the CRs in the array can be permutedfbtVector
- Vector that is to be filled with the FromBaseTable
StandardException
- Thrown on errorvoid disableBulkFetch()
void doSpecialMaxScan()
boolean isPossibleDistinctScan(java.util.Set distinctColumns)
isPossibleDistinctScan
in class ResultSetNode
distinctColumns
- the set of distinct columns
void markForDistinctScan()
markForDistinctScan
in class ResultSetNode
void adjustForSortElimination()
ResultSetNode
adjustForSortElimination
in class ResultSetNode
ResultSetNode.adjustForSortElimination()
void adjustForSortElimination(RequiredRowOrdering rowOrdering) throws StandardException
ResultSetNode
adjustForSortElimination
in class ResultSetNode
StandardException
ResultSetNode.adjustForSortElimination()
private boolean isOrdered(ColumnReference[] crs, ConglomerateDescriptor cd) throws StandardException
crs
- The specified ColumnReference[]cd
- The ConglomerateDescriptor for the chosen index.
StandardException
- Thrown on errorprivate boolean isStrictlyOrdered(ColumnReference[] crs, ConglomerateDescriptor cd) throws StandardException
crs
- The specified ColumnReference[]cd
- The ConglomerateDescriptor for the chosen index.
StandardException
- Thrown on errorprivate boolean isOneRowResultSet(ConglomerateDescriptor cd, OptimizablePredicateList predList) throws StandardException
StandardException
private int getDefaultBulkFetch() throws StandardException
StandardException
private java.lang.String getUserSpecifiedIndexName()
private StoreCostController getStoreCostController(ConglomerateDescriptor cd) throws StandardException
StandardException
private StoreCostController getBaseCostController() throws StandardException
StandardException
private long baseRowCount() throws StandardException
StandardException
private DataValueDescriptor[] getRowTemplate(ConglomerateDescriptor cd, StoreCostController scc) throws StandardException
StandardException
private ConglomerateDescriptor getFirstConglom() throws StandardException
StandardException
private ConglomerateDescriptor getNextConglom(ConglomerateDescriptor currCD) throws StandardException
StandardException
private void getConglomDescs() throws StandardException
StandardException
public void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, java.lang.String parentResultSetId, boolean dependentScan)
setRefActionInfo
in class QueryTreeNode
void acceptChildren(Visitor v) throws StandardException
acceptChildren
in class ResultSetNode
v
- the visitor
StandardException
- on error
|
Built on Thu 2010-12-23 20:49:13+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |