org.h2.command.dml.Query.getCost()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(272)

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

Query.getCost介绍

[英]Calculate the cost to execute this query.
[中]计算执行此查询的成本。

代码示例

代码示例来源:origin: com.h2database/h2

@Override
public double getCost(Session session, int[] masks,
    TableFilter[] filters, int filter, SortOrder sortOrder,
    HashSet<Column> allColumnsSet) {
  return recursive ? 1000 : query.getCost();
}

代码示例来源:origin: com.h2database/h2

@Override
public double getCost() {
  return left.getCost() + right.getCost();
}

代码示例来源:origin: com.eventsourcing/h2

@Override
public double getCost() {
  return left.getCost() + right.getCost();
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

public int getCost() {
  return 10 + (int) (10 * query.getCost());
}

代码示例来源:origin: org.wowtools/h2

@Override
public double getCost() {
  return left.getCost() + right.getCost();
}

代码示例来源:origin: org.wowtools/h2

@Override
public double getCost(Session session, int[] masks,
    TableFilter[] filters, int filter, SortOrder sortOrder,
    HashSet<Column> allColumnsSet) {
  return recursive ? 1000 : query.getCost();
}

代码示例来源:origin: com.eventsourcing/h2

@Override
public double getCost(Session session, int[] masks,
    TableFilter[] filters, int filter, SortOrder sortOrder,
    HashSet<Column> allColumnsSet) {
  return recursive ? 1000 : query.getCost();
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

public int getCost() {
  return 10 + (int) (10 * query.getCost());
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

public double getCost() {
  return left.getCost() + right.getCost();
}

代码示例来源:origin: org.wowtools/h2

/**
 * Calculate the cost when used as a subquery.
 * This method returns a value between 10 and 1000000,
 * to ensure adding other values can't result in an integer overflow.
 *
 * @return the estimated cost as an integer
 */
public int getCostAsExpression() {
  // ensure the cost is not larger than 1 million,
  // so that adding other values can't overflow
  return (int) Math.min(1000000.0, 10.0 + 10.0 * getCost());
}

代码示例来源:origin: com.eventsourcing/h2

/**
 * Calculate the cost when used as a subquery.
 * This method returns a value between 10 and 1000000,
 * to ensure adding other values can't result in an integer overflow.
 *
 * @return the estimated cost as an integer
 */
public int getCostAsExpression() {
  // ensure the cost is not larger than 1 million,
  // so that adding other values can't overflow
  return (int) Math.min(1000000.0, 10.0 + 10.0 * getCost());
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

public int getCost() {
  return left.getCost() + 10 + (int) (10 * query.getCost());
}

代码示例来源:origin: com.h2database/com.springsource.org.h2

query = (Query) session.prepare(sql);
double cost = query.getCost();
cachedCost = new CostElement();
cachedCost.evaluatedAt = System.currentTimeMillis();

相关文章