|
|||||||||
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.TableOperatorNode
org.apache.derby.impl.sql.compile.SetOperatorNode
org.apache.derby.impl.sql.compile.IntersectOrExceptNode
public class IntersectOrExceptNode
A IntersectOrExceptNode represents an INTERSECT or EXCEPT DML statement.
Field Summary | |
---|---|
private boolean |
addNewNodesCalled
|
static int |
EXCEPT_OP
|
private int[] |
intermediateOrderByColumns
|
private int[] |
intermediateOrderByDirection
|
private boolean[] |
intermediateOrderByNullsLow
|
static int |
INTERSECT_OP
|
private int |
opType
|
Fields inherited from class org.apache.derby.impl.sql.compile.SetOperatorNode |
---|
all, fetchFirst, offset, orderByList |
Fields inherited from class org.apache.derby.impl.sql.compile.TableOperatorNode |
---|
leftOptimizer, leftResultSet, rightOptimizer, rightResultSet |
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 | |
---|---|
IntersectOrExceptNode()
|
Method Summary | |
---|---|
private ResultSetNode |
addNewNodes()
Add any new ResultSetNodes that are necessary to the tree. |
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)
Generate the code. |
CostEstimate |
getFinalCostEstimate()
Get the final CostEstimate for this FromTable. |
(package private) java.lang.String |
getOperatorName()
|
private int |
getOpType()
|
(package private) double |
getRowCountEstimate(double leftRowCount,
double rightRowCount)
|
(package private) double |
getSingleScanRowCountEstimate(double leftSingleScanRowCount,
double rightSingleScanRowCount)
|
void |
init(java.lang.Object opType,
java.lang.Object leftResult,
java.lang.Object rightResult,
java.lang.Object all,
java.lang.Object tableProperties)
Initializer for a SetOperatorNode. |
Optimizable |
modifyAccessPath(JBitSet outerTables)
Modify the access path for this Optimizable, as necessary. |
ResultSetNode |
modifyAccessPaths()
Modify the access paths according to the decisions the optimizer made. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Push order by lists down to the children so that we can implement the intersect/except by scan of the two sorted inputs. |
private void |
pushOrderingDown(ResultSetNode rsn)
|
Methods inherited from class org.apache.derby.impl.sql.compile.TableOperatorNode |
---|
acceptChildren, adjustForSortElimination, adjustForSortElimination, bindExpressions, bindExpressionsWithTables, bindNonVTITables, bindVTITables, decrementLevel, getExposedName, getLeftmostResultSet, getLeftResultSet, getRightResultSet, init, needsSpecialRCLBinding, optimize, optimizeSource, projectResultColumns, referencesSessionSchema, referencesTarget, rejectParameters, setLeftmostResultSet, setLevel, setNestedInParens, setReferencedColumns, updateBestPlanMap, verifyProperties |
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 |
---|
private int opType
public static final int INTERSECT_OP
public static final int EXCEPT_OP
private boolean addNewNodesCalled
private int[] intermediateOrderByColumns
private int[] intermediateOrderByDirection
private boolean[] intermediateOrderByNullsLow
Constructor Detail |
---|
public IntersectOrExceptNode()
Method Detail |
---|
public void init(java.lang.Object opType, java.lang.Object leftResult, java.lang.Object rightResult, java.lang.Object all, java.lang.Object tableProperties) throws StandardException
init
in class QueryTreeNode
leftResult
- The ResultSetNode on the left side of this unionrightResult
- The ResultSetNode on the right side of this unionall
- Whether or not this is an ALL.tableProperties
- Properties list associated with the table
StandardException
- Thrown on errorprivate int getOpType()
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class SetOperatorNode
numTables
- Number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if any
StandardException
- Thrown on errorprivate void pushOrderingDown(ResultSetNode rsn) throws StandardException
StandardException
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)
public Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException
Optimizable
modifyAccessPath
in interface Optimizable
modifyAccessPath
in class TableOperatorNode
outerTables
- Bit map of the tables that are outer to this one
in the join order.
StandardException
- Thrown on errorOptimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)
public ResultSetNode modifyAccessPaths() throws StandardException
ResultSetNode
modifyAccessPaths
in class TableOperatorNode
StandardException
- Thrown on errorResultSetNode.modifyAccessPaths()
private ResultSetNode addNewNodes() throws StandardException
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 method for the generated code to go into
StandardException
- Thrown on errorpublic CostEstimate getFinalCostEstimate() throws StandardException
FromTable
getFinalCostEstimate
in class FromTable
StandardException
Get the final CostEstimate for this IntersectOrExceptNode.
java.lang.String getOperatorName()
getOperatorName
in class SetOperatorNode
double getRowCountEstimate(double leftRowCount, double rightRowCount)
double getSingleScanRowCountEstimate(double leftSingleScanRowCount, double rightSingleScanRowCount)
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |