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

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

本文整理了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

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

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

  1. @Override
  2. public double getCost() {
  3. return left.getCost() + right.getCost();
  4. }

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

  1. @Override
  2. public double getCost() {
  3. return left.getCost() + right.getCost();
  4. }

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

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

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

  1. @Override
  2. public double getCost() {
  3. return left.getCost() + right.getCost();
  4. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章