public double divideBy(RelOptCost cost) {
    // Compute the geometric average of the ratios of all of the factors
    // which are non-zero and finite.
    double d = 1;
    double n = 0;
    if ((this.rowCount != 0) && !Double.isInfinite(this.rowCount) && (cost.getRows() != 0)
        && !Double.isInfinite(cost.getRows())) {
      d *= this.rowCount / cost.getRows();
      ++n;
    }
    if ((this.cpu != 0) && !Double.isInfinite(this.cpu) && (cost.getCpu() != 0)
        && !Double.isInfinite(cost.getCpu())) {
      d *= this.cpu / cost.getCpu();
      ++n;
    }
    if ((this.io != 0) && !Double.isInfinite(this.io) && (cost.getIo() != 0)
        && !Double.isInfinite(cost.getIo())) {
      d *= this.io / cost.getIo();
      ++n;
    }
    if (n == 0) {
      return 1.0;
    }
    return Math.pow(d, 1 / n);
  }
NOTE:<br>
1. HiveCost normalizes cpu and io in to time.<br>
2. CPU, IO cost is added together to find the query latency.<br>
3. If query latency is equal then row count is compared.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/cost/HiveCost.java