Package org.apache.derby.iapi.sql.compile

Examples of org.apache.derby.iapi.sql.compile.OptimizerPlan$ConglomerateRS


     * </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 )
                {
View Full Code Here


                    break;
                }
            }

            // at this point, figure out if the plan so far is a prefix of the desired plan
            OptimizerPlan   candidate = OptimizerPlan.makeRowSource( getTupleDescriptor( curOpt ), dDictionary );
            if ( candidate == null )
            {
                retval = false;
                break;
            }
            if ( currentPlan != null )
            {
                candidate = new OptimizerPlan.Join
                    (
                     curOpt.getCurrentAccessPath().getJoinStrategy(),
                     currentPlan,
                     candidate
                     );
            }

            if ( candidate.isLeftPrefixOf( overridingPlan ) )
            {
                currentPlan = candidate;
                break;
            }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.compile.OptimizerPlan$ConglomerateRS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.