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 returned 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.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| pack-priv ConglomerateDescriptor | |
| pack-priv PredicateList | baseTableRestrictionList
Restriction as a PredicateList |
| pack-priv int | |
| pack-priv boolean | |
| private String[] | |
| pack-priv ConglomerateDescriptor[] | |
| pack-priv static final int | |
| private JBitSet | |
| private boolean | |
| private boolean | |
| private int[] | |
| private long | |
| private boolean | |
| private boolean | |
| private boolean | hasCheckedIndexStats
Whether or not we have checked the index statistics for staleness. |
| private boolean | |
| pack-priv boolean | |
| pack-priv PredicateList | |
| pack-priv PredicateList | |
| private boolean | raDependentScan
Information for dependent table scan for Referential Actions |
| private String | |
| private FormatableBitSet | |
| pack-priv PredicateList | |
| pack-priv PredicateList | |
| private long | |
| private String | |
| private double | |
| private boolean | |
| pack-priv PredicateList | |
| pack-priv TableDescriptor | |
| pack-priv TableName | |
| private String | |
| private ResultColumnList | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv int | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | FromBaseTable(TableName
The name of the table tableName, String The correlation name correlationName, ResultColumnList The derived column list derivedRCL, Properties The Properties list associated with the table. tableProperties, ContextManager The context manager cm)Constructor for a table in a FROM list. |
| pack-priv | FromBaseTable(TableName
The name of the table tableName, String The correlation name correlationName, int Table is being updated/deleted from. updateOrDelete, ResultColumnList The derived column list derivedRCL, ContextManager The context manager cm)Initializer for a table in a FROM list. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | acceptChildren(Visitor
the visitor v)Overrides org. Accept the visitor for all visitable children of this node. |
| pack-priv ResultColumnList | Returns: ResultColumnList the rclThe original list inputRcl, FormatableBitSet bit set of cols we want colsWeWant)Augment the RCL to include the columns in the FormatableBitSet. |
| pack-priv void | adjustForSortElimination()
Overrides org. Notify the underlying result set tree that the optimizer has chosen to "eliminate" a sort. |
| pack-priv void | adjustForSortElimination(RequiredRowOrdering rowOrdering)
Overrides org. 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 | |
| pack-priv void | bindExpressions(FromList
FromList to use/append to. fromListParam)Overrides org. Bind the expressions in this FromBaseTable. |
| pack-priv ResultSetNode | Returns: ResultSetNode The FromTable for the table or resolved view.The DataDictionary to use for binding dataDictionary, FromList FromList to use/append to. fromListParam)Overrides org. Bind the table in this FromBaseTable. |
| pack-priv void | bindResultColumns(FromList
FromList to use/append to. fromListParam)Overrides org. Bind the result columns of this ResultSetNode when there is no base table to bind them to. |
| private TableDescriptor | |
| protected boolean | canBeOrdered()
Overrides org. Tell super-class that this Optimizable can be ordered |
| pack-priv ResultSetNode | changeAccessPath()
Overrides org. The optimizer's decision on the access path for a result set may require the generation of extra result sets. |
| pack-priv void | clearDependency(List<Integer>
list of bit numbers to be cleared locations)Clear the bits from the dependency map when join nodes are flattened |
| public int | convertAbsoluteToRelativeColumnPosition(int
The absolute 0-based column position for the column. absolutePosition)Overrides org. Implements org. Convert an absolute to a relative 0-based column position. |
| protected boolean | Returns: true/falseOverrides org. Is this a table that has a FOR UPDATE clause? |
| pack-priv void | |
| pack-priv void | |
| public CostEstimate | estimateCost(OptimizablePredicateList
The predicate list to optimize against predList, ConglomerateDescriptor The conglomerate descriptor to get the cost of cd, CostEstimate The estimated cost of the part of the plan outer
to this optimizable. outerCost, Optimizer The optimizer to use to help estimate the cost optimizer, RowOrdering The row ordering for all the tables in the
join order, including this one. rowOrdering)Overrides org. Implements org.
Estimate the cost of scanning this |
| public boolean | forUpdate()
Overrides org. Implements org. Return true if this is the target table of an update |
| pack-priv void | generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built acb, MethodBuilder the execute() method to be built mb)Overrides org. Generation on a FromBaseTable creates a scan on the optimizer-selected conglomerate. |
| private void | |
| private void | |
| private void | generateRefActionDependentTableScan(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The execute() method to be built mb)Generation on a FromBaseTable for a referential action dependent table. |
| pack-priv void | generateResultSet(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built acb, MethodBuilder The execute() method to be built mb)Overrides org. Generation on a FromBaseTable for a SELECT. |
| protected ResultSetNode | Returns: The generated ProjectRestrictNode atop the original FromTable.Number of tables in the DML Statement numTables)Overrides org. Put a ProjectRestrictNode on top of each FromTable in the FromList. |
| pack-priv ResultColumnList | Returns: ResultColumnList representing all referenced columnsBuild a ResultColumnList based on all of the columns in this FromBaseTable. |
| pack-priv ResultColumnList | Returns: ResultColumnList List of result columns from this table.The qualifier on the "*" allTableName)Overrides org. Return a ResultColumnList with all of the columns in this table. |
| private StoreCostController | |
| public String | getBaseTableName()
Overrides org. Implements org. Get the table name of this Optimizable. |
| private void | |
| private int | |
| pack-priv boolean | Returns: Whether or not this FBT represents an EXISTS FBT.Does this FBT represent an EXISTS FBT. |
| pack-priv String | Returns: The exposed name of this table.Overrides org. 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. |
| pack-priv TableName | Returns: TableName The exposed name of this table.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. |
| pack-priv CostEstimate | Returns: The final CostEstimate for this ResultSetNode.Overrides org. Get the final CostEstimate for this ResultSetNode. |
| private ConglomerateDescriptor | |
| pack-priv FromTable | Returns: The FromTable, if any, with the exposed name.The specified name to search for as an exposed name. name, String Schema name, if non-null. schemaName, boolean Whether or not we need an exact match on specified schema and table
names or match on table id. exactMatch)Overrides org. Determine whether or not the specified name is an exposed name in the current query block. |
| pack-priv ResultColumn | Returns: A ResultColumn whose expression is the ColumnNode that matches the ColumnReference. Returns null if there is no match.The columnReference whose name we're looking
for in the given table. columnReference)Overrides org. Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference. |
| private ConglomerateDescriptor | |
| private DataValueDescriptor[] | |
| private int | |
| private StoreCostController | |
| public TableDescriptor | getTableDescriptor()
Overrides org. Implements org. Get the table descriptor for this table (if any). |
| pack-priv TableName | Returns: a TableName node representing this FromTable.Overrides org. Return a TableName node representing this FromTable. |
| pack-priv TableName | |
| private String | |
| public int | initialCapacity()
Overrides org. Implements org. Return the initial capacity of the hash table, for hash join strategy |
| public boolean | isBaseTable()
Overrides org. Implements org. Tell whether this Optimizable represents a base table |
| public boolean | isCoveringIndex(ConglomerateDescriptor
ConglomerateDesriptor for index to consider cd)Overrides org. Implements org. Return whether or not this is a covering index. |
| public boolean | isMaterializable()
Overrides org. Implements org. Tell whether this Optimizable is materializable |
| pack-priv boolean | isNotExists()
Overrides org. Return whether or not this is actually a EBT for NOT EXISTS. |
| pack-priv boolean | Returns: Whether or not the underlying ResultSet tree will return a single row.Overrides org. Return whether or not the underlying ResultSet tree will return a single row, at most. |
| pack-priv boolean | |
| private boolean | isOneRowResultSet(ConglomerateDescriptor cd, OptimizablePredicateList predList)
Is this a one-row result set with the given conglomerate descriptor? |
| public boolean | isOneRowScan()
Overrides org. Implements org. Will the optimizable return at most 1 row per scan? |
| private boolean | Returns: Whether or not this index is ordered exactly on the specified columns.The specified ColumnReference[] crs, ConglomerateDescriptor The ConglomerateDescriptor for the chosen index. cd)Return whether or not this index is ordered on a permutation of the specified columns. |
| pack-priv boolean | Returns: Whether the underlying ResultSet tree is ordered on the specified column.The specified ColumnReference[] crs, boolean Whether or not the order of the CRs in the array can be permuted permuteOrdering, List<FromBaseTable> List that is to be filled with the FromBaseTable fbtHolder)Overrides org. Return whether or not the underlying ResultSet tree is ordered on the specified columns. |
| pack-priv boolean | Returns: Whether or not it is possible to do a distinct scan on this ResultSet tree.the set of distinct columns distinctColumns)Overrides org. Is it possible to do a distinct scan on this ResultSet tree. |
| private boolean | Returns: Whether or not this index is ordered exactly on the specified columns.The specified ColumnReference[] crs, ConglomerateDescriptor The ConglomerateDescriptor for the chosen index. cd)Return whether or not this index is ordered on a permutation of the specified columns. |
| public boolean | isTargetTable()
Overrides org. Implements org. Is the optimizable the target table of an update or delete? |
| private boolean | |
| public boolean | legalJoinOrder(JBitSet
The tables that have been placed so far in the join order. assignedTableMap)Overrides org. Implements org. Can this Optimizable appear at the current location in the join order. |
| public float | loadFactor()
Overrides org. Implements org. Return the load factor of the hash table, for hash join strategy |
| pack-priv boolean | LOJ_reorderable(int numTables)
Overrides org. no LOJ reordering for base table. |
| pack-priv JBitSet | LOJgetReferencedTables(int numTables)
Overrides org.
|
| private int | Returns: The relative 0-based column position.The absolute 0-based column position. absolutePosition)Convert an absolute to a relative 0-based column position. |
| private ResultSetNode | mapTableAsVTI(TableDescriptor td, String correlationName, ResultColumnList resultColumns, Properties tableProperties, ContextManager cm)
Return a node that represents invocation of the virtual table for the given table descriptor. |
| pack-priv boolean | markAsCursorTargetTable()
Overrides org. Mark this ResultSetNode as the target table of an updatable cursor. |
| pack-priv void | markForDistinctScan()
Overrides org. Mark the underlying scan as a distinct scan. |
| pack-priv void | markUpdated(ResultColumnList
A ResultColumnList representing the columns
to be updated. 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. |
| public boolean | memoryUsageOK(double rowCount, int maxMemoryPerTable)
Overrides org. Implements org.
|
| private ResultColumnList | Returns: A new ResultColumnList that reflects the columns in the index.The original list of columns, which reflects
the columns in the base table. oldColumns, ConglomerateDescriptor The ConglomerateDescriptor, which describes
the index that the new ResultColumnList will
reflect. idxCD, ConglomerateDescriptor The ConglomerateDescriptor for the base heap heapCD, boolean Whether or not to clone the RCs cloneRCs)Create a new ResultColumnList to reflect the columns in the index described by the given ConglomerateDescriptor. |
| public boolean | nextAccessPath(Optimizer
Optimizer to use. optimizer, OptimizablePredicateList 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. predList, 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. rowOrdering)Overrides org. Implements org. Choose the next access path to evaluate for this Optimizable. |
| public CostEstimate | optimizeIt(Optimizer
Optimizer to use. optimizer, OptimizablePredicateList The predicate list to optimize against predList, CostEstimate The CostEstimate for the outer tables in the join order,
telling how many times this Optimizable will be scanned. outerCost, RowOrdering The row ordering for all the tables in the
join order, including this one. rowOrdering)Overrides org. Implements org. Choose the best access path for this Optimizable. |
| pack-priv ResultSetNode | Returns: ResultSetNode at top of preprocessed tree.The number of tables in the DML Statement numTables, GroupByList The group by list, if any gbl, FromList The from list, if any fromList)Overrides org. Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. |
| public void | pullOptPredicates(OptimizablePredicateList
The list to put the pulled predicates
in. optimizablePredicates)Overrides org. Implements org. Pull all the OptimizablePredicates from this Optimizable and put them in the given OptimizablePredicateList. |
| private void | |
| public boolean | pushOptPredicate(OptimizablePredicate
OptimizablePredicate to push down. optimizablePredicate)Overrides org. Implements org. Push an OptimizablePredicate down, if this node accepts it. |
| private boolean | Returns: true if qualified, false if notthe table to check td)Tells if the given table qualifies for a statistics update check in the current configuration. |
| public boolean | Returns: true if references SESSION schema tables, else falseOverrides org. Return true if the node references SESSION schema tables (temporary or permanent) |
| pack-priv boolean | Returns: true if found, else falseTable name (String) to search for. name, boolean Whether or not name is for a base table baseTable)Overrides org. Search to see if a query references the specifed table name. |
| private double | scanCostAfterSelectivity(double originalScanCost, double initialPositionCost, double selectivity, boolean anotherIndexUnique)
|
| pack-priv void | setExistsBaseTable(boolean
Whether or not an EXISTS FBT. existsBaseTable, JBitSet The dependency map for the EXISTS FBT. dependencyMap, boolean Whether or not for NOT EXISTS, more specifically. isNotExists)Set whether or not this FBT represents an EXISTS FBT. |
| private void | |
| pack-priv void | setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan)
Overrides org. set the Information gathered from the parent table that is required to perform a referential action on dependent table. |
| pack-priv void | |
| pack-priv void | setTableProperties(Properties
The new table properties. tableProperties)Set the table properties for this table. |
| public void | startOptimizing(Optimizer optimizer, RowOrdering rowOrdering)
Overrides org. Implements org. Begin the optimization process for this Optimizable. |
| protected boolean | Returns: Whether or not the columns marked as true are a supersetThe columns to consider 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 | Returns: Whether or not the columns marked as true for one at least one table are a supersetThe columns to consider 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. |
| public String | Returns: This object as a StringOverrides org. Convert this object to a String. |
| public double | uniqueJoin(OptimizablePredicateList
The predicate list to check predList)Overrides org. Implements org. Does this optimizable have a uniqueness condition on the given predicate list, and if so, how many unique keys will be returned per scan. |
| pack-priv int | Returns: The lock modeOverrides org. Get the lock mode for the target table heap of an update or delete statement. |
| public void | verifyProperties(DataDictionary
The DataDictionary to use. dDictionary)Overrides org. Implements org. Verify that the Properties list with optimizer overrides, if specified, is valid |