kangkaisen commented on a change in pull request #3722:
URL: https://github.com/apache/incubator-doris/pull/3722#discussion_r432806386



##########
File path: docs/zh-CN/administrator-guide/running-profile.md
##########
@@ -0,0 +1,151 @@
+---
+{
+    "title": "查询执行的统计",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# 查询执行的统计
+
+本文档主要介绍Doris在查询执行的统计结果。利用这些统计的信息,可以更好的帮助我们了解Doris的执行情况,并有针对性的进行相应**Debug与调优工作**。
+
+
+## 名词解释
+
+* FE:Frontend,Doris 的前端节点。负责元数据管理和请求接入。
+* BE:Backend,Doris 的后端节点。负责查询执行和数据存储。
+* Fragment:FE会将具体的SQL语句的执行转化为对应的Fragment并下发到BE进行执行。BE上执行对应Fragment,并将结果汇聚返回给FE。
+
+## 基本原理
+
+FE将查询计划拆分成为Fragment下发到BE进行任务执行。BE在执行Fragment时记录了**运行状态时的统计值**,并将Fragment执行的统计信息输出到日志之中。
 FE也可以通过开关将各个Fragment记录的这些统计值进行搜集,并在FE的Web页面上打印结果。
+
+## 操作流程
+
+通过Mysql命令,将FE上的Report的开关打开
+
+```
+mysql> set is_report_success=true; 
+```
+
+之后执行对应的SQL语句之后,在FE的Web页面就可以看到对应SQL语句执行的Report信息:
+![image.png](https://upload-images.jianshu.io/upload_images/8552201-f5308be377dc4d90.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
+
+这里会列出最新执行完成的**100条语句**,我们可以通过Profile查看详细的统计信息。
+```
+Query:
+  Summary:
+    Query ID: 9664061c57e84404-85ae111b8ba7e83a
+    Start Time: 2020-05-02 10:34:57
+    End Time: 2020-05-02 10:35:08
+    Total: 10s323ms
+    Query Type: Query
+    Query State: EOF
+    Doris Version: trunk
+    User: root
+    Default Db: default_cluster:test
+    Sql Statement: select max(Bid_Price) from quotes group by Symbol
+```
+这里详尽的列出了**查询的ID,执行时间,执行语句**等等的总结信息。接下来内容是打印从BE收集到的各个Fragement的详细信息。
+ ```
+    Fragment 0:
+      Instance 9664061c57e84404-85ae111b8ba7e83d 
(host=TNetworkAddress(hostname:10.144.192.47, port:9060)):(Active: 10s270ms, % 
non-child: 0.14%)
+         - MemoryLimit: 2.00 GB
+         - BytesReceived: 168.08 KB
+         - PeakUsedReservation: 0.00 
+         - SendersBlockedTimer: 0ns
+         - DeserializeRowBatchTimer: 501.975us
+         - PeakMemoryUsage: 577.04 KB
+         - RowsProduced: 8.322K (8322)
+        EXCHANGE_NODE (id=4):(Active: 10s256ms, % non-child: 99.35%)
+           - ConvertRowBatchTime: 180.171us
+           - PeakMemoryUsage: 0.00 
+           - RowsReturned: 8.322K (8322)
+           - MemoryUsed: 0.00 
+           - RowsReturnedRate: 811
+```
+这里列出了Fragment的ID;```hostname```指的是执行Fragment的BE节点;```Active:10s270ms```表示该节点的执行总时间;```non-child:
 0.14%```表示除了执行节点自身的执行时间,不包含子节点的执行时间。后续依次打印子节点的统计信息,**这里可以通过缩进区分节点之间的父子关系**。

Review comment:
       ```suggestion
   
这里列出了Fragment的ID;```hostname```指的是执行Fragment的BE节点;```Active:10s270ms```表示该节点的执行总时间;```non-child:
 0.14%```表示该节点自身的执行时间,不包含子节点的执行时间。后续依次打印子节点的统计信息,**这里可以通过缩进区分节点之间的父子关系**。
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to