Modifier and Type | Field and Description |
---|---|
private java.lang.StringBuilder |
_buffer |
Constructor and Description |
---|
DefaultOptTrace()
Make a DefaultOptTrace
|
Modifier and Type | Method and Description |
---|---|
private void |
appendTraceString(java.lang.String traceString)
Append a string to the optimizer trace
|
void |
printToWriter(java.io.PrintWriter out)
Print the trace so far.
|
private java.lang.String |
reportConglomerateDescriptor(ConglomerateDescriptor cd) |
private java.lang.String |
reportCostForTable(java.lang.Object cost,
int tableNumber) |
private java.lang.String |
reportCostIncluding(java.lang.String selectivityType,
CostEstimate cost,
int tableNumber) |
private java.lang.String |
reportJoinOrder(java.lang.String prefix,
boolean addJoinOrderNumber,
int joinOrderNumber,
int joinPosition,
int[] joinOrder,
JBitSet assignedTableMap) |
void |
traceAddingUnorderedOptimizable(int predicateCount)
Say that we're adding an unordered optimizable.
|
void |
traceChangingAccessPathForTable(int tableNumber)
Say that we're considering a different access path for a table.
|
void |
traceCheapestPlanSoFar(int planType,
CostEstimate currentCost)
Report the cost of the cheapest plan so far.
|
void |
traceCompleteJoinOrder()
Say that we have a complete join order.
|
void |
traceCompositeSelectivityFromStatistics(double statCompositeSelectivity)
Report the selectivity calculated from SYSSTATISTICS.
|
void |
traceConsideringConglomerate(ConglomerateDescriptor cd,
int tableNumber)
Report that we are considering a conglomerate for a table.
|
void |
traceConsideringJoinStrategy(JoinStrategy js,
int tableNumber)
Say that we're considering a particular join strategy on a particular table.
|
void |
traceConstantStartStopPositions()
Say that we're setting the lock mode to MODE_RECORD because the start and stop positions are all constant.
|
void |
traceCostIncludingCompositeSelectivityFromStats(CostEstimate cost,
int tableNumber)
Report the cost based on selectivities coming out of SYSSTATISTICS.
|
void |
traceCostIncludingExtra1stColumnSelectivity(CostEstimate cost,
int tableNumber)
Report the cost of a scan given the selectivity of an extra first column.
|
void |
traceCostIncludingExtraNonQualifierSelectivity(CostEstimate cost,
int tableNumber)
Report the cost if we include an extra non-qualifier.
|
void |
traceCostIncludingExtraQualifierSelectivity(CostEstimate cost,
int tableNumber)
Report the cost if we include an extra qualifier.
|
void |
traceCostIncludingExtraStartStop(CostEstimate cost,
int tableNumber)
Report the cost if we include an extra start/stop.
|
void |
traceCostIncludingStatsForIndex(CostEstimate cost,
int tableNumber)
Report the cost based on index statistics.
|
void |
traceCostOfConglomerateScan(int tableNumber,
ConglomerateDescriptor cd,
CostEstimate costEstimate,
int numExtraFirstColumnPreds,
double extraFirstColumnSelectivity,
int numExtraStartStopPreds,
double extraStartStopSelectivity,
int startStopPredCount,
double statStartStopSelectivity,
int numExtraQualifiers,
double extraQualifierSelectivity,
int numExtraNonQualifiers,
double extraNonQualifierSelectivity)
Report the cost of a conglomerate scan.
|
void |
traceCostOfNoncoveringIndex(CostEstimate cost,
int tableNumber)
Report the cost of using a non-covering index.
|
void |
traceCostOfNScans(int tableNumber,
double rowCount,
CostEstimate cost)
Report the cost of scanning a table a certain number of times
|
void |
traceCostWithoutSortAvoidance(CostEstimate currentCost)
Report the cost without a sort.
|
void |
traceCostWithSortAvoidance(CostEstimate currentSortAvoidanceCost)
Report the cost with sort avoidance.
|
void |
traceCurrentPlanAvoidsSort(CostEstimate bestCost,
CostEstimate currentSortAvoidanceCost)
Say that the current plan avoids a sort.
|
void |
traceEndQueryBlock()
End tracing the optimization of a query block.
|
void |
traceEstimatingCostOfConglomerate(ConglomerateDescriptor cd,
int tableNumber)
Report the cost of using a particular conglomerate to scan a table.
|
void |
traceHashKeyColumns(int[] hashKeyColumns)
Report the columns being traced
|
void |
traceIllegalUserJoinOrder()
Say that the user specified an impossible join order.
|
void |
traceJoinOrderConsideration(int joinPosition,
int[] proposedJoinOrder,
JBitSet assignedTableMap)
Say that we're considering a join order.
|
void |
traceLookingForSpecifiedIndex(java.lang.String indexName,
int tableNumber)
Say that we're looking for an index specified by optimizer hints.
|
void |
traceModifyingAccessPaths(int optimizerID)
Say that we're modifying access paths.
|
void |
traceNextAccessPath(java.lang.String baseTable,
int predicateCount)
Report that we are advancing to the next access path for the table.
|
void |
traceNoBestPlan()
Say that we couldn't find a best plan.
|
void |
traceNoMoreConglomerates(int tableNumber)
Say that we have exhausted the conglomerate possibilities for a table.
|
void |
traceNonCoveringIndexCost(double cost,
int tableNumber)
Say that we're considering a non-covering index.
|
void |
traceNoStartStopPosition()
Say that we're setting the lock mode to MODE_TABLE because there is no start/stop position.
|
void |
traceOptimizingJoinNode()
Say that we're starting to optimize a join node
|
void |
traceRememberingBestAccessPath(AccessPath accessPath,
int tableNumber,
int planType)
Report that we've found a best access path.
|
void |
traceRememberingBestAccessPathSubstring(AccessPath ap,
int tableNumber)
Report the best access path for the table so far.
|
void |
traceRememberingBestJoinOrder(int joinPosition,
int[] bestJoinOrder,
int planType,
CostEstimate planCost,
JBitSet assignedTableMap)
Say that we are remembering the current plan as the best join order so far.
|
void |
traceRememberingBestSortAvoidanceAccessPathSubstring(AccessPath ap,
int tableNumber)
Report the best sort-avoiding access path for this table so far.
|
void |
traceRememberingBestUnknownAccessPathSubstring(AccessPath ap,
int tableNumber)
Report an optimizer failure, e.g., while optimizing an outer join
|
void |
traceRememberingJoinStrategy(JoinStrategy joinStrategy,
int tableNumber)
Say that we've found a new best join strategy for the table.
|
void |
traceScanningHeapWithUniqueKey()
Say that we're considering scanning a heap even though we have a unique key match.
|
void |
traceShortCircuiting(boolean timeExceeded,
Optimizable thisOpt,
int joinPosition)
Say that we short-circuited a join order.
|
void |
traceSingleMatchedRowCost(double cost,
int tableNumber)
Report the cost of a scan which will match exactly one row.
|
void |
traceSkipHashJoinNoHashKeys()
Say we won't consider a hash join because there are no hash key columns.
|
void |
traceSkippingBecauseTooMuchMemory(int maxMemoryPerTable)
Say that we are skipping a plan because it consumes too much memory.
|
void |
traceSkippingJoinOrder(int nextOptimizable,
int joinPosition,
int[] proposedJoinOrder,
JBitSet assignedTableMap)
Say that we're skipping the join order starting with the next optimizable.
|
void |
traceSkipUnmaterializableHashJoin()
Say that we won't consider a hash join because the result can't be materialized
|
void |
traceSortCost(CostEstimate sortCost,
CostEstimate currentCost)
Report the sort cost.
|
void |
traceSortNeededForOrdering(int planType,
RequiredRowOrdering requiredRowOrdering)
Report that this plan needs a sort
|
void |
traceStartQueryBlock(long timeOptimizationStarted,
int optimizerID,
OptimizableList optimizableList)
Start optimizer tracing for a query block.
|
void |
traceStartStatement(java.lang.String statementText)
Start the start of tracing a statement.
|
void |
traceTimeout(long currentTime,
CostEstimate bestCost)
Say that the optimizer ran out of time.
|
void |
traceUserJoinOrderOptimized()
Say that we have optimized the user-specified join order.
|
void |
traceVacuous()
Say that there's nothing to optimizer.
|
public void traceStartStatement(java.lang.String statementText)
OptTrace
traceStartStatement
in interface OptTrace
public void traceStartQueryBlock(long timeOptimizationStarted, int optimizerID, OptimizableList optimizableList)
OptTrace
traceStartQueryBlock
in interface OptTrace
public void traceEndQueryBlock()
OptTrace
traceEndQueryBlock
in interface OptTrace
public void traceTimeout(long currentTime, CostEstimate bestCost)
OptTrace
traceTimeout
in interface OptTrace
public void traceVacuous()
OptTrace
traceVacuous
in interface OptTrace
public void traceCompleteJoinOrder()
OptTrace
traceCompleteJoinOrder
in interface OptTrace
public void traceSortCost(CostEstimate sortCost, CostEstimate currentCost)
OptTrace
traceSortCost
in interface OptTrace
public void traceNoBestPlan()
OptTrace
traceNoBestPlan
in interface OptTrace
public void traceModifyingAccessPaths(int optimizerID)
OptTrace
traceModifyingAccessPaths
in interface OptTrace
public void traceShortCircuiting(boolean timeExceeded, Optimizable thisOpt, int joinPosition)
OptTrace
traceShortCircuiting
in interface OptTrace
public void traceSkippingJoinOrder(int nextOptimizable, int joinPosition, int[] proposedJoinOrder, JBitSet assignedTableMap)
OptTrace
traceSkippingJoinOrder
in interface OptTrace
public void traceIllegalUserJoinOrder()
OptTrace
traceIllegalUserJoinOrder
in interface OptTrace
public void traceUserJoinOrderOptimized()
OptTrace
traceUserJoinOrderOptimized
in interface OptTrace
public void traceJoinOrderConsideration(int joinPosition, int[] proposedJoinOrder, JBitSet assignedTableMap)
OptTrace
traceJoinOrderConsideration
in interface OptTrace
public void traceCostWithoutSortAvoidance(CostEstimate currentCost)
OptTrace
traceCostWithoutSortAvoidance
in interface OptTrace
public void traceCostWithSortAvoidance(CostEstimate currentSortAvoidanceCost)
OptTrace
traceCostWithSortAvoidance
in interface OptTrace
public void traceCurrentPlanAvoidsSort(CostEstimate bestCost, CostEstimate currentSortAvoidanceCost)
OptTrace
traceCurrentPlanAvoidsSort
in interface OptTrace
public void traceCheapestPlanSoFar(int planType, CostEstimate currentCost)
OptTrace
traceCheapestPlanSoFar
in interface OptTrace
public void traceSortNeededForOrdering(int planType, RequiredRowOrdering requiredRowOrdering)
OptTrace
traceSortNeededForOrdering
in interface OptTrace
public void traceRememberingBestJoinOrder(int joinPosition, int[] bestJoinOrder, int planType, CostEstimate planCost, JBitSet assignedTableMap)
OptTrace
traceRememberingBestJoinOrder
in interface OptTrace
public void traceSkippingBecauseTooMuchMemory(int maxMemoryPerTable)
OptTrace
traceSkippingBecauseTooMuchMemory
in interface OptTrace
public void traceCostOfNScans(int tableNumber, double rowCount, CostEstimate cost)
OptTrace
traceCostOfNScans
in interface OptTrace
public void traceSkipUnmaterializableHashJoin()
OptTrace
traceSkipUnmaterializableHashJoin
in interface OptTrace
public void traceSkipHashJoinNoHashKeys()
OptTrace
traceSkipHashJoinNoHashKeys
in interface OptTrace
public void traceHashKeyColumns(int[] hashKeyColumns)
OptTrace
traceHashKeyColumns
in interface OptTrace
public void traceOptimizingJoinNode()
OptTrace
traceOptimizingJoinNode
in interface OptTrace
public void traceConsideringJoinStrategy(JoinStrategy js, int tableNumber)
OptTrace
traceConsideringJoinStrategy
in interface OptTrace
public void traceRememberingBestAccessPath(AccessPath accessPath, int tableNumber, int planType)
OptTrace
traceRememberingBestAccessPath
in interface OptTrace
public void traceNoMoreConglomerates(int tableNumber)
OptTrace
traceNoMoreConglomerates
in interface OptTrace
public void traceConsideringConglomerate(ConglomerateDescriptor cd, int tableNumber)
OptTrace
traceConsideringConglomerate
in interface OptTrace
public void traceScanningHeapWithUniqueKey()
OptTrace
traceScanningHeapWithUniqueKey
in interface OptTrace
public void traceAddingUnorderedOptimizable(int predicateCount)
OptTrace
traceAddingUnorderedOptimizable
in interface OptTrace
public void traceChangingAccessPathForTable(int tableNumber)
OptTrace
traceChangingAccessPathForTable
in interface OptTrace
public void traceNoStartStopPosition()
OptTrace
traceNoStartStopPosition
in interface OptTrace
public void traceNonCoveringIndexCost(double cost, int tableNumber)
OptTrace
traceNonCoveringIndexCost
in interface OptTrace
public void traceConstantStartStopPositions()
OptTrace
traceConstantStartStopPositions
in interface OptTrace
public void traceEstimatingCostOfConglomerate(ConglomerateDescriptor cd, int tableNumber)
OptTrace
traceEstimatingCostOfConglomerate
in interface OptTrace
public void traceLookingForSpecifiedIndex(java.lang.String indexName, int tableNumber)
OptTrace
traceLookingForSpecifiedIndex
in interface OptTrace
public void traceSingleMatchedRowCost(double cost, int tableNumber)
OptTrace
traceSingleMatchedRowCost
in interface OptTrace
public void traceCostIncludingExtra1stColumnSelectivity(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingExtra1stColumnSelectivity
in interface OptTrace
public void traceNextAccessPath(java.lang.String baseTable, int predicateCount)
OptTrace
traceNextAccessPath
in interface OptTrace
public void traceCostIncludingExtraStartStop(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingExtraStartStop
in interface OptTrace
public void traceCostIncludingExtraQualifierSelectivity(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingExtraQualifierSelectivity
in interface OptTrace
public void traceCostIncludingExtraNonQualifierSelectivity(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingExtraNonQualifierSelectivity
in interface OptTrace
public void traceCostOfNoncoveringIndex(CostEstimate cost, int tableNumber)
OptTrace
traceCostOfNoncoveringIndex
in interface OptTrace
public void traceRememberingJoinStrategy(JoinStrategy joinStrategy, int tableNumber)
OptTrace
traceRememberingJoinStrategy
in interface OptTrace
public void traceRememberingBestAccessPathSubstring(AccessPath ap, int tableNumber)
OptTrace
traceRememberingBestAccessPathSubstring
in interface OptTrace
public void traceRememberingBestSortAvoidanceAccessPathSubstring(AccessPath ap, int tableNumber)
OptTrace
traceRememberingBestSortAvoidanceAccessPathSubstring
in interface OptTrace
public void traceRememberingBestUnknownAccessPathSubstring(AccessPath ap, int tableNumber)
OptTrace
traceRememberingBestUnknownAccessPathSubstring
in interface OptTrace
public void traceCostOfConglomerateScan(int tableNumber, ConglomerateDescriptor cd, CostEstimate costEstimate, int numExtraFirstColumnPreds, double extraFirstColumnSelectivity, int numExtraStartStopPreds, double extraStartStopSelectivity, int startStopPredCount, double statStartStopSelectivity, int numExtraQualifiers, double extraQualifierSelectivity, int numExtraNonQualifiers, double extraNonQualifierSelectivity)
OptTrace
traceCostOfConglomerateScan
in interface OptTrace
public void traceCostIncludingCompositeSelectivityFromStats(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingCompositeSelectivityFromStats
in interface OptTrace
public void traceCompositeSelectivityFromStatistics(double statCompositeSelectivity)
OptTrace
traceCompositeSelectivityFromStatistics
in interface OptTrace
public void traceCostIncludingStatsForIndex(CostEstimate cost, int tableNumber)
OptTrace
traceCostIncludingStatsForIndex
in interface OptTrace
public void printToWriter(java.io.PrintWriter out)
OptTrace
printToWriter
in interface OptTrace
private java.lang.String reportJoinOrder(java.lang.String prefix, boolean addJoinOrderNumber, int joinOrderNumber, int joinPosition, int[] joinOrder, JBitSet assignedTableMap)
private java.lang.String reportConglomerateDescriptor(ConglomerateDescriptor cd)
private java.lang.String reportCostForTable(java.lang.Object cost, int tableNumber)
private java.lang.String reportCostIncluding(java.lang.String selectivityType, CostEstimate cost, int tableNumber)
private void appendTraceString(java.lang.String traceString)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.