org.apache.calcite.util.Util.nLogN()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.apache.calcite.util.Util.nLogN()方法的一些代码示例,展示了Util.nLogN()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.nLogN()方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:nLogN

Util.nLogN介绍

[英]Computes nlogn(n) using the natural logarithm (or n if n < Math#E, so the result is never negative.
[中]使用自然对数计算nlogn(n)(如果n < Math#E,则计算n,因此结果永远不会为负。

代码示例

代码示例来源:origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 double rowCount = mq.getRowCount(this);
 // Right-hand input is the "build", and hopefully small, input.
 final double rightRowCount = right.estimateRowCount(mq);
 final double leftRowCount = left.estimateRowCount(mq);
 if (Double.isInfinite(leftRowCount)) {
  rowCount = leftRowCount;
 } else {
  rowCount += Util.nLogN(leftRowCount);
 }
 if (Double.isInfinite(rightRowCount)) {
  rowCount = rightRowCount;
 } else {
  rowCount += rightRowCount;
 }
 return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d);
}

代码示例来源:origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 double rowCount = mq.getRowCount(this);
 // Right-hand input is the "build", and hopefully small, input.
 final double rightRowCount = right.estimateRowCount(mq);
 final double leftRowCount = left.estimateRowCount(mq);
 if (Double.isInfinite(leftRowCount)) {
  rowCount = leftRowCount;
 } else {
  rowCount += Util.nLogN(leftRowCount);
 }
 if (Double.isInfinite(rightRowCount)) {
  rowCount = rightRowCount;
 } else {
  rowCount += rightRowCount;
 }
 return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d);
}

代码示例来源:origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Higher cost if rows are wider discourages pushing a project through an
 // exchange.
 double rowCount = mq.getRowCount(this);
 double bytesPerRow = getRowType().getFieldCount() * 4;
 return planner.getCostFactory().makeCost(
   Util.nLogN(rowCount) * bytesPerRow, rowCount, 0);
}

代码示例来源:origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Higher cost if rows are wider discourages pushing a project through a
 // sort.
 final double rowCount = mq.getRowCount(this);
 final double bytesPerRow = getRowType().getFieldCount() * 4;
 final double cpu = Util.nLogN(rowCount) * bytesPerRow;
 return planner.getCostFactory().makeCost(rowCount, cpu, 0);
}

代码示例来源:origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Higher cost if rows are wider discourages pushing a project through an
 // exchange.
 double rowCount = mq.getRowCount(this);
 double bytesPerRow = getRowType().getFieldCount() * 4;
 return planner.getCostFactory().makeCost(
   Util.nLogN(rowCount) * bytesPerRow, rowCount, 0);
}

代码示例来源:origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Higher cost if rows are wider discourages pushing a project through a
 // sort.
 final double rowCount = mq.getRowCount(this);
 final double bytesPerRow = getRowType().getFieldCount() * 4;
 final double cpu = Util.nLogN(rowCount) * bytesPerRow;
 return planner.getCostFactory().makeCost(rowCount, cpu, 0);
}

代码示例来源:origin: org.apache.calcite/calcite-core

rowCount = leftRowCount;
} else {
 rowCount += Util.nLogN(leftRowCount);

代码示例来源:origin: Qihoo360/Quicksql

rowCount = leftRowCount;
} else {
 rowCount += Util.nLogN(leftRowCount);

相关文章