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

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


    ** table. Even if this started as a right outer join, it will
    ** have been transformed to a left outer join by this point.
    */
    CostEstimate outerCost = getLeftResultSet().getCostEstimate();

    if (costEstimate.rowCount() < outerCost.rowCount())
    {
      costEstimate.setCost(costEstimate.getEstimatedCost(),
                 outerCost.rowCount(),
                 outerCost.rowCount());
    }
View Full Code Here


    CostEstimate outerCost = getLeftResultSet().getCostEstimate();

    if (costEstimate.rowCount() < outerCost.rowCount())
    {
      costEstimate.setCost(costEstimate.getEstimatedCost(),
                 outerCost.rowCount(),
                 outerCost.rowCount());
    }
  }

    /**
 
View Full Code Here

    if (costEstimate.rowCount() < outerCost.rowCount())
    {
      costEstimate.setCost(costEstimate.getEstimatedCost(),
                 outerCost.rowCount(),
                 outerCost.rowCount());
    }
  }

    /**
     * Generate the code for an inner join node.
View Full Code Here

    }

    mb.push(subqResultSetNumber);
    mb.push(subqueryNumber);
    mb.push(pointOfAttachment);
    mb.push(costEstimate.rowCount());
    mb.push(costEstimate.getEstimatedCost());

    mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSetString, ClassName.NoPutResultSet, nargs);

View Full Code Here

        newCost *= outerCost.rowCount();
      }

      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
View Full Code Here

        optimizer.trace(Optimizer.ROW_LOCK_ALL_CONSTANT_START_STOP,
                0, 0, 0.0, null);
      }
      else
      {
        setLockingBasedOnThreshold(optimizer, costEstimate.rowCount());
      }

      optimizer.trace(Optimizer.COST_OF_N_SCANS,
              tableNumber, 0, outerCost.rowCount(), costEstimate);
View Full Code Here

      {
        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

         * 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

         * 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

      /* 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

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.