org.apache.derby.impl.sql.compile
Class Level2OptimizerImpl
java.lang.Object
org.apache.derby.impl.sql.compile.OptimizerImpl
org.apache.derby.impl.sql.compile.Level2OptimizerImpl
- All Implemented Interfaces:
- Optimizer
public class Level2OptimizerImpl
- extends OptimizerImpl
This is the Level 2 Optimizer.
Fields inherited from class org.apache.derby.impl.sql.compile.OptimizerImpl |
assignedTableMap, bestCost, bestJoinOrder, currentCost, currentSortAvoidanceCost, currentTime, dDictionary, desiredJoinOrderFound, finalCostEstimate, joinPosition, maxMemoryPerTable, nonCorrelatedTableMap, numOptimizables, numTablesInQuery, optimizableList, optimizerTrace, optimizerTraceHtml, predicateList, proposedJoinOrder, requiredRowOrdering, sortCost, timeExceeded, timeLimit, timeOptimizationStarted |
Fields inherited from interface org.apache.derby.iapi.sql.compile.Optimizer |
ADDING_UNORDERED_OPTIMIZABLE, CALLING_NEXT_ACCESS_PATH, CALLING_ON_JOIN_NODE, CHANGING_ACCESS_PATH_FOR_TABLE, CHEAPEST_PLAN_SO_FAR, COMPLETE_JOIN_ORDER, COMPOSITE_SEL_FROM_STATS, CONSIDERING_CONGLOMERATE, CONSIDERING_JOIN_ORDER, CONSIDERING_JOIN_STRATEGY, COST_INCLUDING_COMPOSITE_SEL_FROM_STATS, COST_INCLUDING_EXTRA_1ST_COL_SELECTIVITY, COST_INCLUDING_EXTRA_NONQUALIFIER_SELECTIVITY, COST_INCLUDING_EXTRA_QUALIFIER_SELECTIVITY, COST_INCLUDING_EXTRA_START_STOP, COST_INCLUDING_STATS_FOR_INDEX, COST_OF_CHEAPEST_PLAN_SO_FAR, COST_OF_CONGLOMERATE_SCAN1, COST_OF_CONGLOMERATE_SCAN2, COST_OF_CONGLOMERATE_SCAN3, COST_OF_CONGLOMERATE_SCAN4, COST_OF_CONGLOMERATE_SCAN5, COST_OF_CONGLOMERATE_SCAN6, COST_OF_CONGLOMERATE_SCAN7, COST_OF_N_SCANS, COST_OF_NONCOVERING_INDEX, COST_OF_SORTING, CURRENT_PLAN_IS_SA_PLAN, ESTIMATING_COST_OF_CONGLOMERATE, HJ_HASH_KEY_COLUMNS, HJ_SKIP_NO_JOIN_COLUMNS, HJ_SKIP_NOT_MATERIALIZABLE, ILLEGAL_USER_JOIN_ORDER, JOIN_ORDER_OPTIMIZATION, LOOKING_FOR_SPECIFIED_INDEX, MATCH_SINGLE_ROW_COST, MAX_DYNAMIC_MATERIALIZED_ROWS, MAX_MEMORY_PER_TABLE, MODIFYING_ACCESS_PATHS, MODULE, NO_BEST_PLAN, NO_MORE_CONGLOMERATES, NO_TABLES, NO_TIMEOUT, NON_COVERING_INDEX_COST, NORMAL_PLAN, PLAN_TYPE, REMEMBERING_BEST_ACCESS_PATH, REMEMBERING_BEST_ACCESS_PATH_SUBSTRING, REMEMBERING_BEST_JOIN_ORDER, REMEMBERING_BEST_SORT_AVOIDANCE_ACCESS_PATH_SUBSTRING, REMEMBERING_BEST_UNKNOWN_ACCESS_PATH_SUBSTRING, REMEMBERING_JOIN_STRATEGY, ROW_LOCK_ALL_CONSTANT_START_STOP, ROW_LOCK_UNDER_THRESHOLD, RULE_BASED_OPTIMIZATION, SCANNING_HEAP_FULL_MATCH_ON_UNIQUE_KEY, SHORT_CIRCUITING, SKIPPING_DUE_TO_EXCESS_MEMORY, SKIPPING_JOIN_ORDER, SORT_AVOIDANCE_PLAN, SORT_NEEDED_FOR_ORDERING, STARTED, TABLE_LOCK_NO_START_STOP, TABLE_LOCK_OVER_THRESHOLD, TIME_EXCEEDED, TOTAL_COST_NON_SA_PLAN, TOTAL_COST_SA_PLAN, TOTAL_COST_WITH_SORTING, USE_STATISTICS, USER_JOIN_ORDER_OPTIMIZED |
Constructor Summary |
Level2OptimizerImpl(OptimizableList optimizableList,
OptimizablePredicateList predicateList,
DataDictionary dDictionary,
boolean ruleBasedOptimization,
boolean noTimeout,
boolean useStatistics,
int maxMemoryPerTable,
JoinStrategy[] joinStrategies,
int tableLockThreshold,
RequiredRowOrdering requiredRowOrdering,
int numTablesInQuery,
LanguageConnectionContext lcc)
|
Method Summary |
private java.lang.String |
bestCost()
|
private java.lang.String |
buildJoinOrder(java.lang.String prefix,
boolean addJoinOrderNumber,
int joinOrderNumber,
int[] joinOrder)
|
private java.lang.String |
costForTable(java.lang.Object cost,
int tableNumber)
|
private java.lang.String |
costIncluding(java.lang.String selectivityType,
java.lang.Object objectParam1,
int intParam1)
|
private java.lang.String |
dumpConglomerateDescriptor(ConglomerateDescriptor cd)
|
int |
getLevel()
Get the level of this optimizer. |
CostEstimateImpl |
getNewCostEstimate(double theCost,
double theRowCount,
double theSingleScanRowCount)
|
private java.lang.String |
lockModeThreshold(java.lang.String lockMode,
java.lang.String relop,
double rowCount,
int threshold)
|
CostEstimate |
newCostEstimate()
Get a new CostEstimate object |
void |
trace(int traceFlag,
int intParam1,
int intParam2,
double doubleParam,
java.lang.Object objectParam1)
Optimizer trace. |
Methods inherited from class org.apache.derby.impl.sql.compile.OptimizerImpl |
addScopedPredicatesToList, considerCost, costOptimizable, costPermutation, getDataDictionary, getFinalCost, getJoinStrategy, getJoinStrategy, getMaxMemoryPerTable, getNextDecoratedPermutation, getNextPermutation, getNumberOfJoinStrategies, getOptimizedCost, modifyAccessPaths, prepForNextRound, pushPredicates, setOuterRows, tableLockThreshold, uniqueJoinWithOuterTable, updateBestPlanMaps, useStatistics |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lcc
private LanguageConnectionContext lcc
Level2OptimizerImpl
Level2OptimizerImpl(OptimizableList optimizableList,
OptimizablePredicateList predicateList,
DataDictionary dDictionary,
boolean ruleBasedOptimization,
boolean noTimeout,
boolean useStatistics,
int maxMemoryPerTable,
JoinStrategy[] joinStrategies,
int tableLockThreshold,
RequiredRowOrdering requiredRowOrdering,
int numTablesInQuery,
LanguageConnectionContext lcc)
throws StandardException
- Throws:
StandardException
getLevel
public int getLevel()
- Description copied from interface:
Optimizer
- Get the level of this optimizer.
- Specified by:
getLevel
in interface Optimizer
- Overrides:
getLevel
in class OptimizerImpl
- Returns:
- The level of this optimizer.
- See Also:
Optimizer.getLevel()
newCostEstimate
public CostEstimate newCostEstimate()
- Description copied from interface:
Optimizer
- Get a new CostEstimate object
- Specified by:
newCostEstimate
in interface Optimizer
- Overrides:
newCostEstimate
in class OptimizerImpl
- See Also:
Optimizer.newCostEstimate()
getNewCostEstimate
public CostEstimateImpl getNewCostEstimate(double theCost,
double theRowCount,
double theSingleScanRowCount)
- Overrides:
getNewCostEstimate
in class OptimizerImpl
trace
public void trace(int traceFlag,
int intParam1,
int intParam2,
double doubleParam,
java.lang.Object objectParam1)
- Description copied from interface:
Optimizer
- Optimizer trace.
- Specified by:
trace
in interface Optimizer
- Overrides:
trace
in class OptimizerImpl
costForTable
private java.lang.String costForTable(java.lang.Object cost,
int tableNumber)
bestCost
private java.lang.String bestCost()
buildJoinOrder
private java.lang.String buildJoinOrder(java.lang.String prefix,
boolean addJoinOrderNumber,
int joinOrderNumber,
int[] joinOrder)
lockModeThreshold
private java.lang.String lockModeThreshold(java.lang.String lockMode,
java.lang.String relop,
double rowCount,
int threshold)
costIncluding
private java.lang.String costIncluding(java.lang.String selectivityType,
java.lang.Object objectParam1,
int intParam1)
dumpConglomerateDescriptor
private java.lang.String dumpConglomerateDescriptor(ConglomerateDescriptor cd)
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.