@Override public Double visit(ScanPlan plan) { try { Long byteCount = plan.getEstimatedBytesToScan(); Long rowCount = plan.getEstimatedRowsToScan(); if (byteCount != null && rowCount != null) { if (byteCount == 0) { return 0.0; } if (rowCount != 0) { return ((double) byteCount) / rowCount; } } } catch (SQLException e) { } return null; }
@Override public Cost getCost() { Long byteCount = null; try { byteCount = getEstimatedBytesToScan(); } catch (SQLException e) { // ignored. } Double outputBytes = this.accept(new ByteCountVisitor()); if (byteCount == null || outputBytes == null) { return Cost.UNKNOWN; } int parallelLevel = CostUtil.estimateParallelLevel( true, context.getConnection().getQueryServices()); Cost cost = new Cost(0, 0, byteCount); if (!orderBy.getOrderByExpressions().isEmpty()) { Cost orderByCost = CostUtil.estimateOrderByCost(byteCount, outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return cost; }
@Override public Double visit(ScanPlan plan) { try { Long byteCount = plan.getEstimatedBytesToScan(); Long rowCount = plan.getEstimatedRowsToScan(); if (byteCount != null && rowCount != null) { if (byteCount == 0) { return 0.0; } if (rowCount != 0) { return ((double) byteCount) / rowCount; } } } catch (SQLException e) { } return null; }
@Override public Double visit(ScanPlan plan) { try { Long byteCount = plan.getEstimatedBytesToScan(); Long rowCount = plan.getEstimatedRowsToScan(); if (byteCount != null && rowCount != null) { if (byteCount == 0) { return 0.0; } if (rowCount != 0) { return ((double) byteCount) / rowCount; } } } catch (SQLException e) { } return null; }
@Override public Cost getCost() { Long byteCount = null; try { byteCount = getEstimatedBytesToScan(); } catch (SQLException e) { // ignored. } Double outputBytes = this.accept(new ByteCountVisitor()); if (byteCount == null || outputBytes == null) { return Cost.UNKNOWN; } int parallelLevel = CostUtil.estimateParallelLevel( true, context.getConnection().getQueryServices()); Cost cost = new Cost(0, 0, byteCount); if (!orderBy.getOrderByExpressions().isEmpty()) { Cost orderByCost = CostUtil.estimateOrderByCost(byteCount, outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return cost; }
@Override public Cost getCost() { Long byteCount = null; try { byteCount = getEstimatedBytesToScan(); } catch (SQLException e) { // ignored. } Double outputBytes = this.accept(new ByteCountVisitor()); if (byteCount == null || outputBytes == null) { return Cost.UNKNOWN; } int parallelLevel = CostUtil.estimateParallelLevel( true, context.getConnection().getQueryServices()); Cost cost = new Cost(0, 0, byteCount); if (!orderBy.getOrderByExpressions().isEmpty()) { Cost orderByCost = CostUtil.estimateOrderByCost(byteCount, outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return cost; }