Examples of CostParams


Examples of sql.optimizers.name.CostParams

  }

  // this method also set latency for useful work
  @Override
  protected void setBatchSize(DataSourceComponent source, Map<String, CostParams> compCost) {
    final CostParams params = compCost.get(source.getName());

    // batch size cannot be bigger than relation size (NATION, REGION, ...
    // tables)
    long maxBatchSize = SystemParameters.getInt(_map, "BATCH_SIZE");
    final long relSize = _schema.getTableSize(_tan.getSchemaName(source.getName()));
    if (relSize < maxBatchSize)
      maxBatchSize = relSize;

    int batchSize = (int) (maxBatchSize * params.getSelectivity());
    if (batchSize < 1)
      batchSize = 1; // cannot be less than 1
    params.setBatchSize(batchSize);
    final double latency = batchSize * ClusterConstants.getReadTime();
    params.setLatency(latency); // this is only due to useful work
    params.setTotalAvgLatency(latency);
  }
View Full Code Here

Examples of sql.optimizers.name.CostParams

  }

  @Override
  protected void setBatchSize(EquiJoinComponent joinComponent, Map<String, CostParams> compCost) {
    final Component[] parents = joinComponent.getParents();
    final CostParams leftParams = compCost.get(parents[0].getName());
    final CostParams rightParams = compCost.get(parents[1].getName());
    final CostParams params = compCost.get(joinComponent.getName());

    final double ratio = params.getSelectivity();
    final int parallelism = params.getParallelism(); // batch size has to be set
    // after the parallelism
    final int leftBatchSize = leftParams.getBatchSize();
    final int leftBatchIn = leftBatchSize / parallelism;
    final int rightBatchSize = rightParams.getBatchSize();
    final int rightBatchIn = rightBatchSize / parallelism;
    final int leftParallelism = leftParams.getParallelism();
    final int rightParallelism = rightParams.getParallelism();

    // TODO: this implies that both components finish at the same time
    // (optimization of parallelism of sources won't work)
    final double iqs = leftParallelism * leftBatchIn + rightParallelism * rightBatchIn;
    int batchSize = (int) (ratio * iqs);
    if (batchSize < 1)
      batchSize = 1; // cannot be less than 1
    params.setBatchSize(batchSize);
  }
View Full Code Here

Examples of sql.optimizers.name.CostParams

  // OPERATORS
  @Override
  public void setParallelism(OperatorComponent opComp, Map<String, CostParams> compCost) {
    super.setParallelism(opComp, compCost);

    final CostParams params = compCost.get(opComp.getName());
    final int parallelism = params.getParallelism();
    final CostParams parentParams = compCost.get(opComp.getParents()[0].getName());
    updateOpLatencies(parallelism, params, parentParams);
  }
View Full Code Here

Examples of sql.optimizers.name.CostParams

  // totalLatency
  // we could also do some pruning
  private double getTotalLatency(NameCompGen ncg) {
    final Map<String, CostParams> allParams = ncg.getCompCost();
    final Component lastComponent = ncg.getQueryPlan().getLastComponent();
    final CostParams lastParams = allParams.get(lastComponent.getName());
    return lastParams.getTotalAvgLatency(); // it's computed as query plan
    // is built on
  }
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.