Examples of rowCount()


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

      {
        double singleFetchCost =
            getBaseCostController().getFetchFromRowLocationCost(
                                (FormatableBitSet) null,
                                0);
        cost = singleFetchCost * costEstimate.rowCount();

        costEstimate.setEstimatedCost(
                costEstimate.getEstimatedCost() + cost);

        optimizer.trace(Optimizer.NON_COVERING_INDEX_COST,
View Full Code Here

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

         * won't return any row or just returns one row (eg., the predicate is a
         * comparison with constant or almost empty table), we do minor adjustment
         * on cost (affecting decision for covering index) and rc (decision for
         * non-covering). The purpose is favoring unique index. beetle 5006.
         */
        if (oneRowResultSetForSomeConglom && costEstimate.rowCount() <= 1)
        {
          costEstimate.setCost(costEstimate.getEstimatedCost() * 2,
                     costEstimate.rowCount() + 2,
                     costEstimate.singleScanRowCount() + 2);
        }
View Full Code Here

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

         * non-covering). The purpose is favoring unique index. beetle 5006.
         */
        if (oneRowResultSetForSomeConglom && costEstimate.rowCount() <= 1)
        {
          costEstimate.setCost(costEstimate.getEstimatedCost() * 2,
                     costEstimate.rowCount() + 2,
                     costEstimate.singleScanRowCount() + 2);
        }
      }

      optimizer.trace(Optimizer.COST_OF_CONGLOMERATE_SCAN1,
View Full Code Here

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

      /* initial row count is the row count without applying
         any predicates-- we use this at the end of the routine
         when we use statistics to recompute the row count.
      */
      double initialRowCount = costEstimate.rowCount();

      if (statStartStopSelectivity != 1.0d)
      {
        /*
        ** If statistics exist use the selectivity computed
View Full Code Here

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

        costEstimate.setCost(
               scanCostAfterSelectivity(costEstimate.getEstimatedCost(),
                            initialPositionCost,
                            statStartStopSelectivity,
                            oneRowResultSetForSomeConglom),
               costEstimate.rowCount() * statStartStopSelectivity,
               costEstimate.singleScanRowCount() *
               statStartStopSelectivity);
        optimizer.trace(Optimizer.COST_INCLUDING_STATS_FOR_INDEX,
                tableNumber, 0, 0.0, costEstimate);

View Full Code Here

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

          costEstimate.setCost(
             scanCostAfterSelectivity(costEstimate.getEstimatedCost(),
                          initialPositionCost,
                          extraFirstColumnSelectivity,
                          oneRowResultSetForSomeConglom),
             costEstimate.rowCount() * extraFirstColumnSelectivity,
             costEstimate.singleScanRowCount() * extraFirstColumnSelectivity);
         
          optimizer.trace(Optimizer.COST_INCLUDING_EXTRA_1ST_COL_SELECTIVITY,
                  tableNumber, 0, 0.0, costEstimate);
        }
View Full Code Here

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

         */
        if (extraStartStopSelectivity != 1.0d)
        {
          costEstimate.setCost(
            costEstimate.getEstimatedCost(),
            costEstimate.rowCount() * extraStartStopSelectivity,
            costEstimate.singleScanRowCount() * extraStartStopSelectivity);

          optimizer.trace(Optimizer.COST_INCLUDING_EXTRA_START_STOP,
                  tableNumber, 0, 0.0, costEstimate);
        }
View Full Code Here

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

       * IN-list).  But for now, we're saying that's okay.
       */
      if (ssKeySourceInList != null)
      {
        int listSize = ssKeySourceInList.getRightOperandList().size();
        double rc = costEstimate.rowCount() * listSize;
        double ssrc = costEstimate.singleScanRowCount() * listSize;

        /* If multiplication by listSize returns more rows than are
         * in the scan then just use the number of rows in the scan.
         */
 
View Full Code Here

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

        ** This is also true for join strategies that scan the
        ** inner table only once (like hash join) - we can
        ** tell if we have one of those, because
        ** multiplyBaseCostByOuterRows() will return false.
        */
        double rowsTouched = costEstimate.rowCount();

        if ( (! constantStartStop) &&
           currentJoinStrategy.multiplyBaseCostByOuterRows())
        {
          /*
 
View Full Code Here

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

          ** locking.
          */
          double r = baseRowCount();
          if (r > 0.0)
          {
            double s = costEstimate.rowCount();
            double o = outerCost.rowCount();
            double pRowsNotTouchedPerScan = 1.0 - (s / r);
            double pRowsNotTouchedAllScans =
                    Math.pow(pRowsNotTouchedPerScan, o);
            double pRowsTouchedAllScans =
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.