chenhao7253886 commented on a change in pull request #531: Add cpu and io indicates to audit log URL: https://github.com/apache/incubator-doris/pull/531#discussion_r247478037
########## File path: fe/src/main/java/org/apache/doris/planner/Planner.java ########## @@ -230,4 +234,38 @@ private PlanNode addUnassignedConjuncts(Analyzer analyzer, PlanNode root) Preconditions.checkState(selectNode.hasValidStats()); return selectNode; } + + private static class QueryStatisticTransferOptimizer { + private final PlanFragment root; + + public QueryStatisticTransferOptimizer(PlanFragment root) { + Preconditions.checkNotNull(root); + this.root = root; + } + + public void optimizeTransferQueryStatistic() { + optimizeTransferQueryStatistic(root, null); + } + + private void optimizeTransferQueryStatistic(PlanFragment fragment, PlanFragment parent) { + if (parent != null && hasLimit(parent.getPlanRoot())) { + fragment.setTransferQueryStatisticWithEveryBatch(true); + } + for (PlanFragment child : fragment.getChildren()) { + optimizeTransferQueryStatistic(child, fragment); + } + } + + private boolean hasLimit(PlanNode planNode) { Review comment: it should judge limit by it's immediate parent. i will fix it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org