* </pre>
*/
private String formatPlanSummary( int[] planOrder, int planType )
{
try {
OptimizerPlan plan = null;
StringBuilder buffer = new StringBuilder();
boolean avoidSort = (planType == Optimizer.SORT_AVOIDANCE_PLAN);
// a negative optimizable number indicates the end of the plan
int planLength = 0;
for ( ; planLength < planOrder.length; planLength++ )
{
if ( planOrder[ planLength ] < 0 ) { break; }
}
for ( int i = 0; i < planLength; i++ )
{
int listIndex = planOrder[ i ];
if ( listIndex >= _currentQueryBlock.optimizableList.size() )
{
// should never happen!
buffer.append( "{ UNKNOWN LIST INDEX " + listIndex + " } " );
continue;
}
Optimizable optimizable = _currentQueryBlock.optimizableList.getOptimizable( listIndex );
AccessPath ap = avoidSort ?
optimizable.getBestSortAvoidancePath() : optimizable.getBestAccessPath();
JoinStrategy js = ap.getJoinStrategy();
UniqueTupleDescriptor utd = OptimizerImpl.isTableFunction( optimizable ) ?
((StaticMethodCallNode) ((FromVTI) ((ProjectRestrictNode) optimizable).getChildResult()).getMethodCall()).ad :
ap.getConglomerateDescriptor();
OptimizerPlan current = (utd == null) ?
new OptimizerPlan.DeadEnd( getOptimizableName( optimizable ).toString() ) :
OptimizerPlan.makeRowSource( utd, _lcc.getDataDictionary() );
if ( plan != null )
{