Examples of Optimizer


Examples of org.apache.derby.iapi.sql.compile.Optimizer

    /*
    ** Get an optimizer.  The only reason we need one is to get a
    ** CostEstimate object, so we can represent the cost of this node.
    ** This seems like overkill, but it's just an object allocation...
    */
    Optimizer optimizer =
          getOptimizer(
                (FromList) getNodeFactory().getNode(
                  C_NodeTypes.FROM_LIST,
                  getNodeFactory().doJoinOrderOptimization(),
                  getContextManager()),
                predicateList,
                dataDictionary,
                (RequiredRowOrdering) null);
    costEstimate = optimizer.newCostEstimate();

    // RESOLVE: THE COST SHOULD TAKE SUBQUERIES INTO ACCOUNT
    costEstimate.setCost(0.0d, outerRows, outerRows);

    subquerys.optimize(dataDictionary, outerRows);
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

  }

  /** @see Optimizable#rememberJoinStrategyAsBest */
  public void rememberJoinStrategyAsBest(AccessPath ap)
  {
    Optimizer optimizer = ap.getOptimizer();

    ap.setJoinStrategy(getCurrentAccessPath().getJoinStrategy());

    optimizer.trace(Optimizer.REMEMBERING_JOIN_STRATEGY, tableNumber, 0, 0.0,
        getCurrentAccessPath().getJoinStrategy());

    if (ap == bestAccessPath)
    {
      optimizer.trace(Optimizer.REMEMBERING_BEST_ACCESS_PATH_SUBSTRING,
              tableNumber, 0, 0.0, ap);
    }
    else if (ap == bestSortAvoidancePath)
    {
      optimizer.trace(Optimizer.REMEMBERING_BEST_SORT_AVOIDANCE_ACCESS_PATH_SUBSTRING,
              tableNumber, 0, 0.0, ap);
    }
    else
    {
      /* We currently get here when optimizing an outer join.
       * (Problem predates optimizer trace change.)
       * RESOLVE - fix this at some point.
      if (SanityManager.DEBUG)
      {
        SanityManager.THROWASSERT(
          "unknown access path type");
      }
       */
      optimizer.trace(Optimizer.REMEMBERING_BEST_UNKNOWN_ACCESS_PATH_SUBSTRING,
              tableNumber, 0, 0.0, ap);
    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

    childResult = childResult.optimize(
                    dataDictionary,
                    predicates,
                    outerRows);

    Optimizer optimizer =
              getOptimizer(
                (FromList) getNodeFactory().getNode(
                  C_NodeTypes.FROM_LIST,
                  getNodeFactory().doJoinOrderOptimization(),
                  getContextManager()),
              predicates,
              dataDictionary,
              (RequiredRowOrdering) null);
    costEstimate = optimizer.newCostEstimate();
    costEstimate.setCost(childResult.getCostEstimate().getEstimatedCost(),
              childResult.getCostEstimate().rowCount(),
              childResult.getCostEstimate().singleScanRowCount());

    return this;
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

    ResultSetNode  retval;
    AccessPath ap = getTrulyTheBestAccessPath();
    ConglomerateDescriptor trulyTheBestConglomerateDescriptor =
                         ap.getConglomerateDescriptor();
    JoinStrategy trulyTheBestJoinStrategy = ap.getJoinStrategy();
    Optimizer optimizer = ap.getOptimizer();

    optimizer.trace(Optimizer.CHANGING_ACCESS_PATH_FOR_TABLE,
            tableNumber, 0, 0.0, null);

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

                  PredicateList predicateList,
                  double outerRows)
        throws StandardException
  {
    /* Get an optimizer, so we can get a cost structure */
    Optimizer optimizer =
              getOptimizer(
                (FromList) getNodeFactory().getNode(
                  C_NodeTypes.FROM_LIST,
                  getNodeFactory().doJoinOrderOptimization(),
                  this,
                  getContextManager()),
                  predicateList,
                  dataDictionary,
                  (RequiredRowOrdering) null);

    costEstimate = optimizer.newCostEstimate();

    /* RESOLVE: This is just a stub for now */
    leftResultSet = leftResultSet.optimize(
                      dataDictionary,
                      predicateList,
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

  public ResultSetNode optimize(DataDictionary dataDictionary,
               PredicateList predicateList,
             double outerRows)
            throws StandardException {
    /* Get an optimizer so we can get a cost */
    Optimizer optimizer = getOptimizer(
                (FromList) getNodeFactory().getNode(
                  C_NodeTypes.FROM_LIST,
                  getNodeFactory().doJoinOrderOptimization(),
                  this,
                  getContextManager()),
                predicateList,
                dataDictionary,
                (RequiredRowOrdering) null);

    /* Assume there is no cost associated with fetching the current row */
    bestCostEstimate = optimizer.newCostEstimate();
    bestCostEstimate.setCost(0.0d, outerRows, outerRows);

    return this;
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

     */
    childResult = (ProjectRestrictNode) childResult.optimize(
                              dataDictionary,
                              predicates,
                              outerRows);
    Optimizer optimizer = getOptimizer(
            (FromList) getNodeFactory().getNode(
              C_NodeTypes.FROM_LIST,
              getNodeFactory().doJoinOrderOptimization(),
              this,
              getContextManager()),
            predicates,
            dataDictionary,
            (RequiredRowOrdering) null);

    // RESOLVE: NEED TO FACTOR IN COST OF SORTING AND FIGURE OUT HOW
    // MANY ROWS HAVE BEEN ELIMINATED.
    costEstimate = optimizer.newCostEstimate();

    costEstimate.setCost(childResult.getCostEstimate().getEstimatedCost(),
               childResult.getCostEstimate().rowCount(),
               childResult.getCostEstimate().singleScanRowCount());

View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

    ResultSetNode  retval;
    AccessPath ap = getTrulyTheBestAccessPath();
    ConglomerateDescriptor trulyTheBestConglomerateDescriptor =
                         ap.getConglomerateDescriptor();
    JoinStrategy trulyTheBestJoinStrategy = ap.getJoinStrategy();
    Optimizer optimizer = ap.getOptimizer();

    optimizer.trace(Optimizer.CHANGING_ACCESS_PATH_FOR_TABLE,
            tableNumber, 0, 0.0, null);

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

    ResultSetNode  retval;
    AccessPath ap = getTrulyTheBestAccessPath();
    ConglomerateDescriptor trulyTheBestConglomerateDescriptor =
                         ap.getConglomerateDescriptor();
    JoinStrategy trulyTheBestJoinStrategy = ap.getJoinStrategy();
    Optimizer optimizer = ap.getOptimizer();

    optimizer.trace(Optimizer.CHANGING_ACCESS_PATH_FOR_TABLE,
            tableNumber, 0, 0.0, null);

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(
View Full Code Here

Examples of org.apache.derby.iapi.sql.compile.Optimizer

    /*
    ** Get an optimizer.  The only reason we need one is to get a
    ** CostEstimate object, so we can represent the cost of this node.
    ** This seems like overkill, but it's just an object allocation...
    */
    Optimizer optimizer =
          getOptimizer(
                (FromList) getNodeFactory().getNode(
                  C_NodeTypes.FROM_LIST,
                  getNodeFactory().doJoinOrderOptimization(),
                  getContextManager()),
                predicateList,
                dataDictionary,
                (RequiredRowOrdering) null);
    costEstimate = optimizer.newCostEstimate();

    // RESOLVE: THE COST SHOULD TAKE SUBQUERIES INTO ACCOUNT
    costEstimate.setCost(0.0d, outerRows, outerRows);

    subquerys.optimize(dataDictionary, outerRows);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.