You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/11/16 15:23:02 UTC

[iotdb] branch QueryMetrics updated: add AggregationScan calcFromRawData & calcFromStatistics

This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch QueryMetrics
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/QueryMetrics by this push:
     new 6041ec13bb add AggregationScan calcFromRawData & calcFromStatistics
6041ec13bb is described below

commit 6041ec13bb345ac9f2124d06af26b00a8a63abbc
Author: liuminghui233 <54...@qq.com>
AuthorDate: Wed Nov 16 23:13:46 2022 +0800

    add AggregationScan calcFromRawData & calcFromStatistics
---
 .../main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java b/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java
index 9edc32bfa4..c893e4015f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.db.mpp.execution.operator.window.IWindow;
 import org.apache.iotdb.db.mpp.execution.operator.window.TimeWindow;
 import org.apache.iotdb.db.mpp.plan.planner.plan.parameter.AggregationStep;
 import org.apache.iotdb.db.mpp.plan.planner.plan.parameter.InputLocation;
+import org.apache.iotdb.db.mpp.statistics.QueryStatistics;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.common.TimeRange;
@@ -62,6 +63,7 @@ public class Aggregator {
 
   // Used for SeriesAggregateScanOperator and RawDataAggregateOperator
   public int processTsBlock(TsBlock tsBlock) {
+    long startTime = System.nanoTime();
     checkArgument(
         step.isInputRaw(),
         "Step in SeriesAggregateScanOperator and RawDataAggregateOperator can only process raw input");
@@ -77,6 +79,8 @@ public class Aggregator {
       lastReadReadIndex =
           Math.max(lastReadReadIndex, accumulator.addInput(controlTimeAndValueColumn, curWindow));
     }
+    QueryStatistics.getInstance()
+        .addCost("AggregationScan: calcFromRawData", System.nanoTime() - startTime);
     return lastReadReadIndex;
   }
 
@@ -112,10 +116,13 @@ public class Aggregator {
 
   /** Used for SeriesAggregateScanOperator. */
   public void processStatistics(Statistics[] statistics) {
+    long startTime = System.nanoTime();
     for (InputLocation[] inputLocations : inputLocationList) {
       int valueIndex = inputLocations[0].getValueColumnIndex();
       accumulator.addStatistics(statistics[valueIndex]);
     }
+    QueryStatistics.getInstance()
+        .addCost("AggregationScan: calcFromStatistics", System.nanoTime() - startTime);
   }
 
   public TSDataType[] getOutputType() {