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

Examples of org.apache.derby.iapi.sql.compile.CostEstimate.singleScanRowCount()


                              rowOrdering);
      /* Copy child cost to this node's cost */
      costEstimate.setCost(
              childCost.getEstimatedCost(),
              childCost.rowCount(),
              childCost.singleScanRowCount());


      // Note: we don't call "optimizer.considerCost()" here because
      // a) the child will make that call as part of its own
      // "optimizeIt()" work above, and b) the child might have
View Full Code Here


      childCost = childResult.costEstimate;

      costEstimate.setCost(
              childCost.getEstimatedCost(),
              childCost.rowCount(),
              childCost.singleScanRowCount());

      /* Note: Prior to the fix for DERBY-781 we had calls here
       * to set the cost estimate for BestAccessPath and
       * BestSortAvoidancePath to equal costEstimate.  That used
       * to be okay because prior to DERBY-781 we would only
View Full Code Here

      // beetle 4787
      else if (extraNonQualifierSelectivity != 1.0d)
      {
        rc = oneRowResultSetForSomeConglom ? costEstimate.rowCount() :
                      costEstimate.rowCount() * extraNonQualifierSelectivity;
        src = costEstimate.singleScanRowCount() * extraNonQualifierSelectivity;
      }
      if (rc != -1) // changed
      {
        costEstimate.setCost(costEstimate.getEstimatedCost(), rc, src);
        optimizer.trace(Optimizer.COST_INCLUDING_EXTRA_NONQUALIFIER_SELECTIVITY,
View Full Code Here

                pushIndexName(cd, mb);
    mb.push(colRefItem);
    mb.push(getTrulyTheBestAccessPath().getLockMode());
    mb.push(tableLockGranularity);
    mb.push(getCompilerContext().getScanIsolationLevel());
    mb.push(costEstimate.singleScanRowCount());
    mb.push(costEstimate.getEstimatedCost());

    mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getLastIndexKeyResultSet",
          ClassName.NoPutResultSet, 13);
View Full Code Here

    mb.push(cd.isConstraint());
    mb.push(colRefItem);
    mb.push(getTrulyTheBestAccessPath().getLockMode());
    mb.push(tableLockGranularity);
    mb.push(getCompilerContext().getScanIsolationLevel());
    mb.push(costEstimate.singleScanRowCount());
    mb.push(costEstimate.getEstimatedCost());
   
    mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getDistinctScanResultSet",
              ClassName.NoPutResultSet, 16);
  }
View Full Code Here

    finalCostEstimate = getNewCostEstimate();
    finalCostEstimate.setCost(leftCE.getEstimatedCost(),
               leftCE.rowCount(),
               leftCE.singleScanRowCount() +
               rightCE.singleScanRowCount());

    finalCostEstimate.add(rightCE, finalCostEstimate);
    return finalCostEstimate;
  }
View Full Code Here

        // The cost is the sum of the two child costs plus the cost of sorting the union.
        costEstimate.setCost( leftCostEstimate.getEstimatedCost() + rightCostEstimate.getEstimatedCost(),
                              getRowCountEstimate( leftCostEstimate.rowCount(),
                                                   rightCostEstimate.rowCount()),
                              getSingleScanRowCountEstimate( leftCostEstimate.singleScanRowCount(),
                                                             rightCostEstimate.singleScanRowCount()));

        return costEstimate;
    } // End of estimateCost

  /**
 
View Full Code Here

    finalCostEstimate = getNewCostEstimate();
    finalCostEstimate.setCost(
      leftCE.getEstimatedCost() + rightCE.getEstimatedCost(),
      getRowCountEstimate(leftCE.rowCount(), rightCE.rowCount()),
      getSingleScanRowCountEstimate(leftCE.singleScanRowCount(),
        rightCE.singleScanRowCount()));

    return finalCostEstimate;
  }

    String getOperatorName()
View Full Code Here

      }

      costEstimate.setCost(
        newCost,
        costEstimate.rowCount() * outerCost.rowCount(),
        costEstimate.singleScanRowCount());

      /*
      ** Choose the lock mode.  If the start/stop conditions are
      ** constant, choose row locking, because we will always match
      ** the same row.  If they are not constant (i.e. they include
View Full Code Here

         */
        if (oneRowResultSetForSomeConglom && costEstimate.rowCount() <= 1)
        {
          costEstimate.setCost(costEstimate.getEstimatedCost() * 2,
                     costEstimate.rowCount() + 2,
                     costEstimate.singleScanRowCount() + 2);
        }
      }

      optimizer.trace(Optimizer.COST_OF_CONGLOMERATE_SCAN1,
              tableNumber, 0, 0.0, cd);
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.