You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2026/05/12 01:31:46 UTC
(doris-website) branch master updated: [doc](observability) Document current query runtime statistics and progress monitoring (#60567) (#3590)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new ff583903025 [doc](observability) Document current query runtime statistics and progress monitoring (#60567) (#3590)
ff583903025 is described below
commit ff5839030252cd6569fdd9aca3ff02d0a9c7196e
Author: Wen Zhenghu <we...@gmail.com>
AuthorDate: Tue May 12 09:31:41 2026 +0800
[doc](observability) Document current query runtime statistics and progress monitoring (#60567) (#3590)
Update documentation for the unified current query runtime statistics
feature
(apache/doris#60567):
- Update query-profile-action.md: expand current_queries endpoint
response with
new columns (scan/cpu/memory/shuffle/spill/cache metrics, task progress)
and
add new fields (processRows, totalTasksNum, finishedTasksNum, progress,
bytesWriteIntoCache) to statistics/{trace_id} endpoint
- Update SHOW-PROC.md: reflect that current_queries and
current_query_stmts
now share the same enriched statistics view since 4.1.1
- Add query-progress-monitor.md: new document explaining how to monitor
running
queries with runtime statistics via SHOW PROC, REST API, and Trace ID,
including example output and column descriptions
- Update sidebar configuration to include the new document
---
.../open-api/fe-http/query-profile-action.md | 79 ++++++--
.../workload-management/query-progress-monitor.md | 206 ++++++++++++++++++++
.../system-info-and-help/SHOW-PROC.md | 4 +-
.../open-api/fe-http/query-profile-action.md | 79 ++++++--
.../workload-management/query-progress-monitor.md | 206 ++++++++++++++++++++
.../system-info-and-help/SHOW-PROC.md | 4 +-
.../open-api/fe-http/query-profile-action.md | 79 ++++++--
.../workload-management/query-progress-monitor.md | 207 +++++++++++++++++++++
.../system-info-and-help/SHOW-PROC.md | 4 +-
.../open-api/fe-http/query-profile-action.md | 79 ++++++--
.../workload-management/query-progress-monitor.md | 207 +++++++++++++++++++++
.../system-info-and-help/SHOW-PROC.md | 4 +-
sidebars-next.ts | 1 +
sidebars.ts | 1 +
14 files changed, 1104 insertions(+), 56 deletions(-)
diff --git a/docs-next/admin-manual/open-api/fe-http/query-profile-action.md b/docs-next/admin-manual/open-api/fe-http/query-profile-action.md
index 27b992db796..4cd1848c023 100644
--- a/docs-next/admin-manual/open-api/fe-http/query-profile-action.md
+++ b/docs-next/admin-manual/open-api/fe-http/query-profile-action.md
@@ -431,7 +431,7 @@ Since Doris version 1.2, admin and root user can view all queries. Ordinary user
### Description
-Same as `show proc "/current_query_stmts"`, return current running queries.
+Return current running queries with runtime statistics. This endpoint shares the same statistics view as `SHOW PROC "/current_queries"` and `SHOW PROC "/current_query_stmts"`, providing task-level progress and resource metrics (scan/cpu/memory/shuffle/spill/cache). Version 4.1.1+.
### Path parameters
@@ -445,19 +445,69 @@ Same as `show proc "/current_query_stmts"`, return current running queries.
```json
{
- "msg": "success",
- "code": 0,
- "data": {
- "columnNames": ["Frontend", "QueryId", "ConnectionId", "Database", "User", "ExecTime", "SqlHash", "Statement"],
- "rows": [
- ["172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "", "root", "6074", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"],
- ["172.19.0.11", "3606cad4e34b49c6-867bf6862cacc645", "3", "", "root", "9306", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"]
- ]
- },
- "count": 0
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
}
```
+| Column | Description |
+| ------ | ----------- |
+| Frontend | The FE node handling the query |
+| QueryId | Unique query identifier |
+| ConnectionId | MySQL connection ID |
+| Catalog | Catalog name |
+| Database | Schema/Database name |
+| User | User who submitted the query |
+| ExecTime | Execution time in milliseconds |
+| SqlHash | MD5 hash of the SQL statement |
+| Statement | SQL statement text |
+| ScanRows | Total rows scanned from storage |
+| ScanBytes | Total bytes scanned from storage |
+| ProcessRows | Rows processed through the execution pipeline |
+| CpuMs | CPU time consumed in milliseconds |
+| MaxPeakMemoryBytes | Maximum memory peak during execution |
+| CurrentUsedMemoryBytes | Current memory used by the query |
+| WorkloadGroupId | ID of the workload group |
+| ShuffleSendBytes | Total bytes sent via shuffle |
+| ShuffleSendRows | Total rows sent via shuffle |
+| ScanBytesFromLocalStorage | Bytes scanned from local storage |
+| ScanBytesFromRemoteStorage | Bytes scanned from remote storage (e.g., HDFS, S3) |
+| SpillWriteBytesToLocalStorage | Bytes spilled to local disk |
+| SpillReadBytesFromLocalStorage | Bytes read back from local spill disk |
+| BytesWriteIntoCache | Bytes written into cache |
+| TotalTasks | Total number of pipeline tasks for this query |
+| FinishedTasks | Number of completed pipeline tasks |
+| Progress | Computed query progress (FinishedTasks / TotalTasks) |
+```
+
## Cancel query
`POST /rest/v2/manager/query/kill/{query_id}`
@@ -509,6 +559,7 @@ Retrieve the statistics of a currently running query by Trace ID. You can call t
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
+ "processRows": 2345678,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
@@ -517,7 +568,11 @@ Retrieve the statistics of a currently running query by Trace ID. You can call t
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
- "spillReadBytesFromLocalStorage": 0
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 74,
+ "finishedTasksNum": 51,
+ "progress": "68%"
},
"count": 0
}
diff --git a/docs-next/admin-manual/workload-management/query-progress-monitor.md b/docs-next/admin-manual/workload-management/query-progress-monitor.md
new file mode 100644
index 00000000000..57384bd3872
--- /dev/null
+++ b/docs-next/admin-manual/workload-management/query-progress-monitor.md
@@ -0,0 +1,206 @@
+---
+{
+ "title": "Monitor Running Queries",
+ "language": "en",
+ "description": "View currently running queries and their runtime statistics including task progress and resource metrics."
+}
+---
+
+Doris provides multiple ways to view currently running queries and their runtime statistics, including task-level progress and resource metrics such as scan/cpu/memory/shuffle/spill/cache counters.
+
+## SHOW PROC
+
+You can use the `SHOW PROC` command to view the list of currently executing queries along with their runtime statistics.
+
+```sql
+SHOW PROC "/current_queries";
+```
+
+### Example Output
+
+```
+*************************** 1. row ***************************
+ QueryId: e00b00b1155d4042-98862b60016a768a
+ ConnectionId: 394
+ Catalog: internal
+ Database: wzhtest
+ User: root
+ ExecTime: 20717
+ SqlHash: cf263b08302d8be436c97dd5e6f0d283
+ Statement: INSERT INTO test_query_progress_tb
+ SELECT DISTINCT k, CONCAT(v, CAST(k AS STRING))
+ FROM test_query_progress_tb
+ WHERE k % 2 = 0
+ ScanRows: 45400000 Rows
+ ScanBytes: 2.70 GB
+ ProcessRows: 75598123 Rows
+ CpuMs: 178336
+ MaxPeakMemoryBytes: 13.03 GB
+ CurrentUsedMemoryBytes: 8.69 GB
+ WorkloadGroupId: 1777125330381
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 31.48 MB
+ ScanBytesFromRemoteStorage: 0.00
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 74
+ FinishedTasks: 51
+ Progress: 68%
+*************************** 2. row ***************************
+ QueryId: e2b8c99658a94743-9ebbf0d036d83295
+ ConnectionId: 9
+ Catalog: hive_test
+ Database: tpch100_parquet
+ User: root
+ ExecTime: 10807
+ SqlHash: f8a30e4182d72cce3eff6cb385005b1f
+ Statement: select ... from supplier, lineitem l1, orders, nation ... limit 100
+ ScanRows: 1102562592 Rows
+ ScanBytes: 9.20 GB
+ ProcessRows: 112176670 Rows
+ CpuMs: 53808
+ MaxPeakMemoryBytes: 3.13 GB
+ CurrentUsedMemoryBytes: 2.50 GB
+ WorkloadGroupId: 1777253545394
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 0.00
+ ScanBytesFromRemoteStorage: 9.20 GB
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 138
+ FinishedTasks: 65
+ Progress: 47%
+```
+
+The `SHOW PROC "/current_query_stmts"` command also returns the same statistics view.
+
+**Since Doris 4.1.1**, both `current_queries` and `current_query_stmts` share the same enriched statistics view, providing runtime metrics and task progress in a unified format.
+
+### Column Descriptions
+
+| Column | Description |
+| ------ | ----------- |
+| QueryId | Unique identifier of the query |
+| ConnectionId | MySQL connection ID |
+| Catalog | Catalog name (e.g., `internal`, `hive_test`) |
+| Database | Database/Schema name |
+| User | User who submitted the query |
+| ExecTime | Execution duration in milliseconds |
+| SqlHash | MD5 hash of the SQL statement |
+| Statement | SQL statement text (truncated for display) |
+| ScanRows | Total rows scanned from storage |
+| ScanBytes | Total bytes scanned from storage |
+| ProcessRows | Rows processed through the execution pipeline. This reflects the actual data volume passing through operators and can be used to observe query throughput |
+| CpuMs | CPU time consumed in milliseconds |
+| MaxPeakMemoryBytes | Maximum memory peak reached during query execution |
+| CurrentUsedMemoryBytes | Current memory being used by the query |
+| WorkloadGroupId | ID of the workload group this query belongs to |
+| ShuffleSendBytes | Total bytes sent via data shuffle between nodes |
+| ShuffleSendRows | Total rows sent via data shuffle between nodes |
+| ScanBytesFromLocalStorage | Bytes scanned from local disk storage |
+| ScanBytesFromRemoteStorage | Bytes scanned from remote storage (e.g., HDFS, S3) |
+| SpillWriteBytesToLocalStorage | Bytes spilled (written) to local disk due to memory pressure |
+| SpillReadBytesFromLocalStorage | Bytes read back from spilled data on local disk |
+| BytesWriteIntoCache | Bytes written into data cache |
+| TotalTasks | Total number of pipeline tasks for this query |
+| FinishedTasks | Number of pipeline tasks that have completed |
+| Progress | Query execution progress percentage, computed as `FinishedTasks / TotalTasks` |
+
+## REST API
+
+You can also retrieve current running queries and their runtime statistics through the HTTP REST API:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/current_queries
+```
+
+This endpoint returns data in JSON format with the same set of columns.
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
+}
+```
+
+### Query Parameters
+
+- `is_all_node`: Optional. Return current running queries from all FE nodes if set to `true`. Default is `true`.
+
+## Real-Time Progress via Trace ID
+
+For real-time query progress monitoring, you can set a Trace ID before executing a query and subsequently poll the statistics endpoint:
+
+```sql
+SET session_context="trace_id:my_trace_id";
+SELECT ...;
+```
+
+Then query the statistics from another session:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/statistics/my_trace_id
+```
+
+Response includes task progress and resource usage:
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "scanRows": 1102562592,
+ "scanBytes": 9878424780,
+ "returnedRows": 12345,
+ "processRows": 112176670,
+ "cpuMs": 53808,
+ "maxPeakMemoryBytes": 3355443200,
+ "currentUsedMemoryBytes": 2684354560,
+ "shuffleSendBytes": 0,
+ "shuffleSendRows": 0,
+ "scanBytesFromLocalStorage": 0,
+ "scanBytesFromRemoteStorage": 9878424780,
+ "spillWriteBytesToLocalStorage": 0,
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 138,
+ "finishedTasksNum": 65,
+ "progress": "47%"
+ },
+ "count": 0
+}
+```
+
+You can periodically call this endpoint to track query progress in real time.
diff --git a/docs-next/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md b/docs-next/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
index 5647a8096c9..c9b38cddfbc 100644
--- a/docs-next/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
+++ b/docs-next/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
@@ -70,8 +70,8 @@ illustrate:
8. cluster_health: Run <code>SHOW PROC '/cluster_health/tablet_health';</code> statement to view the replica status of the entire cluster.
9. colocation_group : This command can view the existing Group information in the cluster. For details, please refer to the [Colocation Join](../../../query-acceleration/colocation-join) chapter
10. current_backend_instances : Displays a list of be nodes that are currently executing jobs
-11. current_queries : View the list of queries being executed, the SQL statement currently running.
-12. current_query_stmts: Returns the currently executing query.
+11. current_queries : View the list of queries being executed with runtime statistics, including task progress and resource metrics (scan/cpu/memory/shuffle/spill/cache). Since 4.1.1, this presents the same enriched view as `current_query_stmts`.
+12. current_query_stmts: Returns the currently executing query with the same statistics view as `current_queries`, providing task-level progress and resource metrics.
13. dbs: Mainly used to view the metadata information of each database and the tables in the Doris cluster. This information includes table structure, partitions, materialized views, data shards and replicas, and more. Through this directory and its subdirectories, you can clearly display the table metadata in the cluster, and locate some problems such as data skew, replica failure, etc.
14. diagnose: Report and diagnose common management and control issues in the cluster, including replica balance and migration, transaction exceptions, etc.
15. frontends: Display all FE node information in the cluster, including IP address, role, status, whether it is a master, etc., equivalent to [SHOW FRONTENDS](../cluster-management/instance-management/SHOW-FRONTENDS)
diff --git a/docs/admin-manual/open-api/fe-http/query-profile-action.md b/docs/admin-manual/open-api/fe-http/query-profile-action.md
index 27b992db796..4cd1848c023 100644
--- a/docs/admin-manual/open-api/fe-http/query-profile-action.md
+++ b/docs/admin-manual/open-api/fe-http/query-profile-action.md
@@ -431,7 +431,7 @@ Since Doris version 1.2, admin and root user can view all queries. Ordinary user
### Description
-Same as `show proc "/current_query_stmts"`, return current running queries.
+Return current running queries with runtime statistics. This endpoint shares the same statistics view as `SHOW PROC "/current_queries"` and `SHOW PROC "/current_query_stmts"`, providing task-level progress and resource metrics (scan/cpu/memory/shuffle/spill/cache). Version 4.1.1+.
### Path parameters
@@ -445,19 +445,69 @@ Same as `show proc "/current_query_stmts"`, return current running queries.
```json
{
- "msg": "success",
- "code": 0,
- "data": {
- "columnNames": ["Frontend", "QueryId", "ConnectionId", "Database", "User", "ExecTime", "SqlHash", "Statement"],
- "rows": [
- ["172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "", "root", "6074", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"],
- ["172.19.0.11", "3606cad4e34b49c6-867bf6862cacc645", "3", "", "root", "9306", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"]
- ]
- },
- "count": 0
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
}
```
+| Column | Description |
+| ------ | ----------- |
+| Frontend | The FE node handling the query |
+| QueryId | Unique query identifier |
+| ConnectionId | MySQL connection ID |
+| Catalog | Catalog name |
+| Database | Schema/Database name |
+| User | User who submitted the query |
+| ExecTime | Execution time in milliseconds |
+| SqlHash | MD5 hash of the SQL statement |
+| Statement | SQL statement text |
+| ScanRows | Total rows scanned from storage |
+| ScanBytes | Total bytes scanned from storage |
+| ProcessRows | Rows processed through the execution pipeline |
+| CpuMs | CPU time consumed in milliseconds |
+| MaxPeakMemoryBytes | Maximum memory peak during execution |
+| CurrentUsedMemoryBytes | Current memory used by the query |
+| WorkloadGroupId | ID of the workload group |
+| ShuffleSendBytes | Total bytes sent via shuffle |
+| ShuffleSendRows | Total rows sent via shuffle |
+| ScanBytesFromLocalStorage | Bytes scanned from local storage |
+| ScanBytesFromRemoteStorage | Bytes scanned from remote storage (e.g., HDFS, S3) |
+| SpillWriteBytesToLocalStorage | Bytes spilled to local disk |
+| SpillReadBytesFromLocalStorage | Bytes read back from local spill disk |
+| BytesWriteIntoCache | Bytes written into cache |
+| TotalTasks | Total number of pipeline tasks for this query |
+| FinishedTasks | Number of completed pipeline tasks |
+| Progress | Computed query progress (FinishedTasks / TotalTasks) |
+```
+
## Cancel query
`POST /rest/v2/manager/query/kill/{query_id}`
@@ -509,6 +559,7 @@ Retrieve the statistics of a currently running query by Trace ID. You can call t
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
+ "processRows": 2345678,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
@@ -517,7 +568,11 @@ Retrieve the statistics of a currently running query by Trace ID. You can call t
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
- "spillReadBytesFromLocalStorage": 0
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 74,
+ "finishedTasksNum": 51,
+ "progress": "68%"
},
"count": 0
}
diff --git a/docs/admin-manual/workload-management/query-progress-monitor.md b/docs/admin-manual/workload-management/query-progress-monitor.md
new file mode 100644
index 00000000000..57384bd3872
--- /dev/null
+++ b/docs/admin-manual/workload-management/query-progress-monitor.md
@@ -0,0 +1,206 @@
+---
+{
+ "title": "Monitor Running Queries",
+ "language": "en",
+ "description": "View currently running queries and their runtime statistics including task progress and resource metrics."
+}
+---
+
+Doris provides multiple ways to view currently running queries and their runtime statistics, including task-level progress and resource metrics such as scan/cpu/memory/shuffle/spill/cache counters.
+
+## SHOW PROC
+
+You can use the `SHOW PROC` command to view the list of currently executing queries along with their runtime statistics.
+
+```sql
+SHOW PROC "/current_queries";
+```
+
+### Example Output
+
+```
+*************************** 1. row ***************************
+ QueryId: e00b00b1155d4042-98862b60016a768a
+ ConnectionId: 394
+ Catalog: internal
+ Database: wzhtest
+ User: root
+ ExecTime: 20717
+ SqlHash: cf263b08302d8be436c97dd5e6f0d283
+ Statement: INSERT INTO test_query_progress_tb
+ SELECT DISTINCT k, CONCAT(v, CAST(k AS STRING))
+ FROM test_query_progress_tb
+ WHERE k % 2 = 0
+ ScanRows: 45400000 Rows
+ ScanBytes: 2.70 GB
+ ProcessRows: 75598123 Rows
+ CpuMs: 178336
+ MaxPeakMemoryBytes: 13.03 GB
+ CurrentUsedMemoryBytes: 8.69 GB
+ WorkloadGroupId: 1777125330381
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 31.48 MB
+ ScanBytesFromRemoteStorage: 0.00
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 74
+ FinishedTasks: 51
+ Progress: 68%
+*************************** 2. row ***************************
+ QueryId: e2b8c99658a94743-9ebbf0d036d83295
+ ConnectionId: 9
+ Catalog: hive_test
+ Database: tpch100_parquet
+ User: root
+ ExecTime: 10807
+ SqlHash: f8a30e4182d72cce3eff6cb385005b1f
+ Statement: select ... from supplier, lineitem l1, orders, nation ... limit 100
+ ScanRows: 1102562592 Rows
+ ScanBytes: 9.20 GB
+ ProcessRows: 112176670 Rows
+ CpuMs: 53808
+ MaxPeakMemoryBytes: 3.13 GB
+ CurrentUsedMemoryBytes: 2.50 GB
+ WorkloadGroupId: 1777253545394
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 0.00
+ ScanBytesFromRemoteStorage: 9.20 GB
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 138
+ FinishedTasks: 65
+ Progress: 47%
+```
+
+The `SHOW PROC "/current_query_stmts"` command also returns the same statistics view.
+
+**Since Doris 4.1.1**, both `current_queries` and `current_query_stmts` share the same enriched statistics view, providing runtime metrics and task progress in a unified format.
+
+### Column Descriptions
+
+| Column | Description |
+| ------ | ----------- |
+| QueryId | Unique identifier of the query |
+| ConnectionId | MySQL connection ID |
+| Catalog | Catalog name (e.g., `internal`, `hive_test`) |
+| Database | Database/Schema name |
+| User | User who submitted the query |
+| ExecTime | Execution duration in milliseconds |
+| SqlHash | MD5 hash of the SQL statement |
+| Statement | SQL statement text (truncated for display) |
+| ScanRows | Total rows scanned from storage |
+| ScanBytes | Total bytes scanned from storage |
+| ProcessRows | Rows processed through the execution pipeline. This reflects the actual data volume passing through operators and can be used to observe query throughput |
+| CpuMs | CPU time consumed in milliseconds |
+| MaxPeakMemoryBytes | Maximum memory peak reached during query execution |
+| CurrentUsedMemoryBytes | Current memory being used by the query |
+| WorkloadGroupId | ID of the workload group this query belongs to |
+| ShuffleSendBytes | Total bytes sent via data shuffle between nodes |
+| ShuffleSendRows | Total rows sent via data shuffle between nodes |
+| ScanBytesFromLocalStorage | Bytes scanned from local disk storage |
+| ScanBytesFromRemoteStorage | Bytes scanned from remote storage (e.g., HDFS, S3) |
+| SpillWriteBytesToLocalStorage | Bytes spilled (written) to local disk due to memory pressure |
+| SpillReadBytesFromLocalStorage | Bytes read back from spilled data on local disk |
+| BytesWriteIntoCache | Bytes written into data cache |
+| TotalTasks | Total number of pipeline tasks for this query |
+| FinishedTasks | Number of pipeline tasks that have completed |
+| Progress | Query execution progress percentage, computed as `FinishedTasks / TotalTasks` |
+
+## REST API
+
+You can also retrieve current running queries and their runtime statistics through the HTTP REST API:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/current_queries
+```
+
+This endpoint returns data in JSON format with the same set of columns.
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
+}
+```
+
+### Query Parameters
+
+- `is_all_node`: Optional. Return current running queries from all FE nodes if set to `true`. Default is `true`.
+
+## Real-Time Progress via Trace ID
+
+For real-time query progress monitoring, you can set a Trace ID before executing a query and subsequently poll the statistics endpoint:
+
+```sql
+SET session_context="trace_id:my_trace_id";
+SELECT ...;
+```
+
+Then query the statistics from another session:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/statistics/my_trace_id
+```
+
+Response includes task progress and resource usage:
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "scanRows": 1102562592,
+ "scanBytes": 9878424780,
+ "returnedRows": 12345,
+ "processRows": 112176670,
+ "cpuMs": 53808,
+ "maxPeakMemoryBytes": 3355443200,
+ "currentUsedMemoryBytes": 2684354560,
+ "shuffleSendBytes": 0,
+ "shuffleSendRows": 0,
+ "scanBytesFromLocalStorage": 0,
+ "scanBytesFromRemoteStorage": 9878424780,
+ "spillWriteBytesToLocalStorage": 0,
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 138,
+ "finishedTasksNum": 65,
+ "progress": "47%"
+ },
+ "count": 0
+}
+```
+
+You can periodically call this endpoint to track query progress in real time.
diff --git a/docs/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md b/docs/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
index 5647a8096c9..c9b38cddfbc 100644
--- a/docs/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
+++ b/docs/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
@@ -70,8 +70,8 @@ illustrate:
8. cluster_health: Run <code>SHOW PROC '/cluster_health/tablet_health';</code> statement to view the replica status of the entire cluster.
9. colocation_group : This command can view the existing Group information in the cluster. For details, please refer to the [Colocation Join](../../../query-acceleration/colocation-join) chapter
10. current_backend_instances : Displays a list of be nodes that are currently executing jobs
-11. current_queries : View the list of queries being executed, the SQL statement currently running.
-12. current_query_stmts: Returns the currently executing query.
+11. current_queries : View the list of queries being executed with runtime statistics, including task progress and resource metrics (scan/cpu/memory/shuffle/spill/cache). Since 4.1.1, this presents the same enriched view as `current_query_stmts`.
+12. current_query_stmts: Returns the currently executing query with the same statistics view as `current_queries`, providing task-level progress and resource metrics.
13. dbs: Mainly used to view the metadata information of each database and the tables in the Doris cluster. This information includes table structure, partitions, materialized views, data shards and replicas, and more. Through this directory and its subdirectories, you can clearly display the table metadata in the cluster, and locate some problems such as data skew, replica failure, etc.
14. diagnose: Report and diagnose common management and control issues in the cluster, including replica balance and migration, transaction exceptions, etc.
15. frontends: Display all FE node information in the cluster, including IP address, role, status, whether it is a master, etc., equivalent to [SHOW FRONTENDS](../cluster-management/instance-management/SHOW-FRONTENDS)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/open-api/fe-http/query-profile-action.md b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/open-api/fe-http/query-profile-action.md
index f1f8ecd46e4..32962154d17 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/open-api/fe-http/query-profile-action.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/open-api/fe-http/query-profile-action.md
@@ -408,7 +408,7 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
### Description
-同 `show proc "/current_query_stmts"`,返回当前正在执行的 query
+返回当前正在执行的查询及其运行时统计信息。该接口与 `SHOW PROC "/current_queries"` 和 `SHOW PROC "/current_query_stmts"` 共享相同的统计视图,提供任务级别的进度信息及资源指标(扫描/CPU/内存/Shuffle/溢写/缓存)。4.1.1 及以上版本可用。
### Path parameters
@@ -422,19 +422,69 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
```json
{
- "msg": "success",
- "code": 0,
- "data": {
- "columnNames": ["Frontend", "QueryId", "ConnectionId", "Database", "User", "ExecTime", "SqlHash", "Statement"],
- "rows": [
- ["172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "", "root", "6074", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"],
- ["172.19.0.11", "3606cad4e34b49c6-867bf6862cacc645", "3", "", "root", "9306", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"]
- ]
- },
- "count": 0
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
}
```
+| 列名 | 描述 |
+| ------ | ----------- |
+| Frontend | 处理该查询的 FE 节点 |
+| QueryId | 唯一的查询标识符 |
+| ConnectionId | MySQL 连接 ID |
+| Catalog | Catalog 名称 |
+| Database | 数据库名称 |
+| User | 提交查询的用户 |
+| ExecTime | 执行时长(毫秒) |
+| SqlHash | SQL 语句的 MD5 哈希值 |
+| Statement | SQL 语句文本 |
+| ScanRows | 从存储层扫描的总行数 |
+| ScanBytes | 从存储层扫描的总字节数 |
+| ProcessRows | 经执行管道处理的行数 |
+| CpuMs | CPU 耗时(毫秒) |
+| MaxPeakMemoryBytes | 执行期间的峰值内存 |
+| CurrentUsedMemoryBytes | 查询当前使用的内存 |
+| WorkloadGroupId | 工作负载组 ID |
+| ShuffleSendBytes | 通过 Shuffle 发送的总字节数 |
+| ShuffleSendRows | 通过 Shuffle 发送的总行数 |
+| ScanBytesFromLocalStorage | 从本地存储扫描的字节数 |
+| ScanBytesFromRemoteStorage | 从远程存储扫描的字节数(如 HDFS、S3) |
+| SpillWriteBytesToLocalStorage | 溢写到本地磁盘的字节数 |
+| SpillReadBytesFromLocalStorage | 从本地溢写磁盘读回的字节数 |
+| BytesWriteIntoCache | 写入缓存的字节数 |
+| TotalTasks | 该查询的 Pipeline 任务总数 |
+| FinishedTasks | 已完成的 Pipeline 任务数 |
+| Progress | 计算得到的查询进度(FinishedTasks / TotalTasks) |
+```
+
## 取消 query
`POST /rest/v2/manager/query/kill/{query_id}`
@@ -486,6 +536,7 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
+ "processRows": 2345678,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
@@ -494,7 +545,11 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
- "spillReadBytesFromLocalStorage": 0
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 74,
+ "finishedTasksNum": 51,
+ "progress": "68%"
},
"count": 0
}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/workload-management/query-progress-monitor.md b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/workload-management/query-progress-monitor.md
new file mode 100644
index 00000000000..e51a64aca16
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/admin-manual/workload-management/query-progress-monitor.md
@@ -0,0 +1,207 @@
+---
+{
+ "title": "监控正在运行的查询",
+ "language": "zh-CN",
+ "description": "查看当前正在运行的查询及其运行时统计信息,包括任务进度和资源指标。",
+ "sidebar_label": "查询进度监控"
+}
+---
+
+Doris 提供了多种方式来查看当前正在运行的查询及其运行时统计信息,包括任务级别的进度和资源指标(如扫描/CPU/内存/Shuffle/溢写/缓存等计数器)。
+
+## SHOW PROC
+
+你可以使用 `SHOW PROC` 命令查看当前正在执行的查询列表及其运行时统计信息。
+
+```sql
+SHOW PROC "/current_queries";
+```
+
+### 示例输出
+
+```
+*************************** 1. row ***************************
+ QueryId: e00b00b1155d4042-98862b60016a768a
+ ConnectionId: 394
+ Catalog: internal
+ Database: wzhtest
+ User: root
+ ExecTime: 20717
+ SqlHash: cf263b08302d8be436c97dd5e6f0d283
+ Statement: INSERT INTO test_query_progress_tb
+ SELECT DISTINCT k, CONCAT(v, CAST(k AS STRING))
+ FROM test_query_progress_tb
+ WHERE k % 2 = 0
+ ScanRows: 45400000 Rows
+ ScanBytes: 2.70 GB
+ ProcessRows: 75598123 Rows
+ CpuMs: 178336
+ MaxPeakMemoryBytes: 13.03 GB
+ CurrentUsedMemoryBytes: 8.69 GB
+ WorkloadGroupId: 1777125330381
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 31.48 MB
+ ScanBytesFromRemoteStorage: 0.00
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 74
+ FinishedTasks: 51
+ Progress: 68%
+*************************** 2. row ***************************
+ QueryId: e2b8c99658a94743-9ebbf0d036d83295
+ ConnectionId: 9
+ Catalog: hive_test
+ Database: tpch100_parquet
+ User: root
+ ExecTime: 10807
+ SqlHash: f8a30e4182d72cce3eff6cb385005b1f
+ Statement: select ... from supplier, lineitem l1, orders, nation ... limit 100
+ ScanRows: 1102562592 Rows
+ ScanBytes: 9.20 GB
+ ProcessRows: 112176670 Rows
+ CpuMs: 53808
+ MaxPeakMemoryBytes: 3.13 GB
+ CurrentUsedMemoryBytes: 2.50 GB
+ WorkloadGroupId: 1777253545394
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 0.00
+ ScanBytesFromRemoteStorage: 9.20 GB
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 138
+ FinishedTasks: 65
+ Progress: 47%
+```
+
+`SHOW PROC "/current_query_stmts"` 命令也返回相同的统计视图。
+
+**自 Doris 4.1.1 起**,`current_queries` 和 `current_query_stmts` 共享相同增强的统计视图,以统一的格式提供运行时指标和任务进度。
+
+### 列说明
+
+| 列名 | 描述 |
+| ------ | ----------- |
+| QueryId | 查询的唯一标识符 |
+| ConnectionId | MySQL 连接 ID |
+| Catalog | Catalog 名称(如 `internal`、`hive_test`) |
+| Database | 数据库/模式名称 |
+| User | 提交查询的用户 |
+| ExecTime | 执行时长,单位毫秒 |
+| SqlHash | SQL 语句的 MD5 哈希值 |
+| Statement | SQL 语句文本(显示时可能被截断) |
+| ScanRows | 从存储层扫描的总行数 |
+| ScanBytes | 从存储层扫描的总字节数 |
+| ProcessRows | 经执行管道处理的行数。反映经过算子的实际数据量,可用于观察查询吞吐量 |
+| CpuMs | CPU 耗时,单位毫秒 |
+| MaxPeakMemoryBytes | 查询执行期间达到的内存峰值 |
+| CurrentUsedMemoryBytes | 查询当前正在使用的内存 |
+| WorkloadGroupId | 该查询所属的工作负载组 ID |
+| ShuffleSendBytes | 节点间数据 Shuffle 发送的总字节数 |
+| ShuffleSendRows | 节点间数据 Shuffle 发送的总行数 |
+| ScanBytesFromLocalStorage | 从本地磁盘存储扫描的字节数 |
+| ScanBytesFromRemoteStorage | 从远程存储(如 HDFS、S3)扫描的字节数 |
+| SpillWriteBytesToLocalStorage | 因内存压力溢写到本地磁盘的字节数 |
+| SpillReadBytesFromLocalStorage | 从本地磁盘溢写数据读回的字节数 |
+| BytesWriteIntoCache | 写入数据缓存的字节数 |
+| TotalTasks | 该查询的 Pipeline 任务总数 |
+| FinishedTasks | 已完成的 Pipeline 任务数 |
+| Progress | 查询执行进度百分比,计算公式为 `FinishedTasks / TotalTasks` |
+
+## REST API
+
+你也可以通过 HTTP REST API 获取当前正在运行的查询及其运行时统计信息:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/current_queries
+```
+
+该接口以 JSON 格式返回相同的列数据。
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
+}
+```
+
+### 查询参数
+
+- `is_all_node`:可选。若为 `true` 则返回所有 FE 节点上当前正在运行的查询。默认为 `true`。
+
+## 通过 Trace ID 实时追踪进度
+
+如需实时监控查询进度,可以在执行查询前设置 Trace ID,随后轮询统计信息接口:
+
+```sql
+SET session_context="trace_id:my_trace_id";
+SELECT ...;
+```
+
+然后通过另一个会话查询统计信息:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/statistics/my_trace_id
+```
+
+返回结果包含任务进度和资源使用情况:
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "scanRows": 1102562592,
+ "scanBytes": 9878424780,
+ "returnedRows": 12345,
+ "processRows": 112176670,
+ "cpuMs": 53808,
+ "maxPeakMemoryBytes": 3355443200,
+ "currentUsedMemoryBytes": 2684354560,
+ "shuffleSendBytes": 0,
+ "shuffleSendRows": 0,
+ "scanBytesFromLocalStorage": 0,
+ "scanBytesFromRemoteStorage": 9878424780,
+ "spillWriteBytesToLocalStorage": 0,
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 138,
+ "finishedTasksNum": 65,
+ "progress": "47%"
+ },
+ "count": 0
+}
+```
+
+你可以定期调用此接口以实时追踪查询的进度。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
index f2f620c3b4d..25c86be00e5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs-next/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
@@ -70,8 +70,8 @@ mysql> show proc "/";
8. cluster_health : 通过 <code>SHOW PROC '/cluster_health/tablet_health'</code>; 命令可以查看整个集群的副本状态。
9. colocation_group : 该命令可以查看集群内已存在的 Group 信息,具体可以查看 [Colocation Join](../../../query-acceleration/colocation-join) 章节
10. current_backend_instances:显示当前正在执行作业的 be 节点列表
-11. current_queries : 查看正在执行的查询列表,当前正在运行的 SQL 语句。
-12. current_query_stmts : 返回当前正在执行的 query。
+11. current_queries : 查看正在执行的查询列表,包含运行时统计信息和任务进度(扫描/CPU/内存/Shuffle/溢写/缓存等指标)。自 4.1.1 起,该视图与 `current_query_stmts` 共享相同的增强统计信息。
+12. current_query_stmts : 返回当前正在执行的 query,与 `current_queries` 共享相同的统计视图,提供任务级别的进度和资源指标。
13. dbs:主要用于查看 Doris 集群中各个数据库以及其中的表的元数据信息。这些信息包括表结构、分区、物化视图、数据分片和副本等等。通过这个目录和其子目录,可以清楚的展示集群中的表元数据情况,以及定位一些如数据倾斜、副本故障等问题
14. diagnose : 报告和诊断集群中的常见管控问题,主要包括副本均衡和迁移、事务异常等
15. frontends:显示集群中所有的 FE 节点信息,包括 IP 地址、角色、状态、是否是 master 等,等同于 [SHOW FRONTENDS](../cluster-management/instance-management/SHOW-FRONTENDS)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/open-api/fe-http/query-profile-action.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/open-api/fe-http/query-profile-action.md
index f1f8ecd46e4..32962154d17 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/open-api/fe-http/query-profile-action.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/open-api/fe-http/query-profile-action.md
@@ -408,7 +408,7 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
### Description
-同 `show proc "/current_query_stmts"`,返回当前正在执行的 query
+返回当前正在执行的查询及其运行时统计信息。该接口与 `SHOW PROC "/current_queries"` 和 `SHOW PROC "/current_query_stmts"` 共享相同的统计视图,提供任务级别的进度信息及资源指标(扫描/CPU/内存/Shuffle/溢写/缓存)。4.1.1 及以上版本可用。
### Path parameters
@@ -422,19 +422,69 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
```json
{
- "msg": "success",
- "code": 0,
- "data": {
- "columnNames": ["Frontend", "QueryId", "ConnectionId", "Database", "User", "ExecTime", "SqlHash", "Statement"],
- "rows": [
- ["172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "", "root", "6074", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"],
- ["172.19.0.11", "3606cad4e34b49c6-867bf6862cacc645", "3", "", "root", "9306", "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)"]
- ]
- },
- "count": 0
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
}
```
+| 列名 | 描述 |
+| ------ | ----------- |
+| Frontend | 处理该查询的 FE 节点 |
+| QueryId | 唯一的查询标识符 |
+| ConnectionId | MySQL 连接 ID |
+| Catalog | Catalog 名称 |
+| Database | 数据库名称 |
+| User | 提交查询的用户 |
+| ExecTime | 执行时长(毫秒) |
+| SqlHash | SQL 语句的 MD5 哈希值 |
+| Statement | SQL 语句文本 |
+| ScanRows | 从存储层扫描的总行数 |
+| ScanBytes | 从存储层扫描的总字节数 |
+| ProcessRows | 经执行管道处理的行数 |
+| CpuMs | CPU 耗时(毫秒) |
+| MaxPeakMemoryBytes | 执行期间的峰值内存 |
+| CurrentUsedMemoryBytes | 查询当前使用的内存 |
+| WorkloadGroupId | 工作负载组 ID |
+| ShuffleSendBytes | 通过 Shuffle 发送的总字节数 |
+| ShuffleSendRows | 通过 Shuffle 发送的总行数 |
+| ScanBytesFromLocalStorage | 从本地存储扫描的字节数 |
+| ScanBytesFromRemoteStorage | 从远程存储扫描的字节数(如 HDFS、S3) |
+| SpillWriteBytesToLocalStorage | 溢写到本地磁盘的字节数 |
+| SpillReadBytesFromLocalStorage | 从本地溢写磁盘读回的字节数 |
+| BytesWriteIntoCache | 写入缓存的字节数 |
+| TotalTasks | 该查询的 Pipeline 任务总数 |
+| FinishedTasks | 已完成的 Pipeline 任务数 |
+| Progress | 计算得到的查询进度(FinishedTasks / TotalTasks) |
+```
+
## 取消 query
`POST /rest/v2/manager/query/kill/{query_id}`
@@ -486,6 +536,7 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
"scanRows": 1234567,
"scanBytes": 987654321,
"returnedRows": 12345,
+ "processRows": 2345678,
"cpuMs": 15600,
"maxPeakMemoryBytes": 536870912,
"currentUsedMemoryBytes": 268435456,
@@ -494,7 +545,11 @@ Admin 和 Root 用户可以查看所有 Query。普通用户仅能查看自己
"scanBytesFromLocalStorage": 734003200,
"scanBytesFromRemoteStorage": 253651121,
"spillWriteBytesToLocalStorage": 0,
- "spillReadBytesFromLocalStorage": 0
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 74,
+ "finishedTasksNum": 51,
+ "progress": "68%"
},
"count": 0
}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/workload-management/query-progress-monitor.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/workload-management/query-progress-monitor.md
new file mode 100644
index 00000000000..e51a64aca16
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/workload-management/query-progress-monitor.md
@@ -0,0 +1,207 @@
+---
+{
+ "title": "监控正在运行的查询",
+ "language": "zh-CN",
+ "description": "查看当前正在运行的查询及其运行时统计信息,包括任务进度和资源指标。",
+ "sidebar_label": "查询进度监控"
+}
+---
+
+Doris 提供了多种方式来查看当前正在运行的查询及其运行时统计信息,包括任务级别的进度和资源指标(如扫描/CPU/内存/Shuffle/溢写/缓存等计数器)。
+
+## SHOW PROC
+
+你可以使用 `SHOW PROC` 命令查看当前正在执行的查询列表及其运行时统计信息。
+
+```sql
+SHOW PROC "/current_queries";
+```
+
+### 示例输出
+
+```
+*************************** 1. row ***************************
+ QueryId: e00b00b1155d4042-98862b60016a768a
+ ConnectionId: 394
+ Catalog: internal
+ Database: wzhtest
+ User: root
+ ExecTime: 20717
+ SqlHash: cf263b08302d8be436c97dd5e6f0d283
+ Statement: INSERT INTO test_query_progress_tb
+ SELECT DISTINCT k, CONCAT(v, CAST(k AS STRING))
+ FROM test_query_progress_tb
+ WHERE k % 2 = 0
+ ScanRows: 45400000 Rows
+ ScanBytes: 2.70 GB
+ ProcessRows: 75598123 Rows
+ CpuMs: 178336
+ MaxPeakMemoryBytes: 13.03 GB
+ CurrentUsedMemoryBytes: 8.69 GB
+ WorkloadGroupId: 1777125330381
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 31.48 MB
+ ScanBytesFromRemoteStorage: 0.00
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 74
+ FinishedTasks: 51
+ Progress: 68%
+*************************** 2. row ***************************
+ QueryId: e2b8c99658a94743-9ebbf0d036d83295
+ ConnectionId: 9
+ Catalog: hive_test
+ Database: tpch100_parquet
+ User: root
+ ExecTime: 10807
+ SqlHash: f8a30e4182d72cce3eff6cb385005b1f
+ Statement: select ... from supplier, lineitem l1, orders, nation ... limit 100
+ ScanRows: 1102562592 Rows
+ ScanBytes: 9.20 GB
+ ProcessRows: 112176670 Rows
+ CpuMs: 53808
+ MaxPeakMemoryBytes: 3.13 GB
+ CurrentUsedMemoryBytes: 2.50 GB
+ WorkloadGroupId: 1777253545394
+ ShuffleSendBytes: 0.00
+ ShuffleSendRows: 0 Rows
+ ScanBytesFromLocalStorage: 0.00
+ ScanBytesFromRemoteStorage: 9.20 GB
+ SpillWriteBytesToLocalStorage: 0.00
+SpillReadBytesFromLocalStorage: 0.00
+ BytesWriteIntoCache: 0.00
+ TotalTasks: 138
+ FinishedTasks: 65
+ Progress: 47%
+```
+
+`SHOW PROC "/current_query_stmts"` 命令也返回相同的统计视图。
+
+**自 Doris 4.1.1 起**,`current_queries` 和 `current_query_stmts` 共享相同增强的统计视图,以统一的格式提供运行时指标和任务进度。
+
+### 列说明
+
+| 列名 | 描述 |
+| ------ | ----------- |
+| QueryId | 查询的唯一标识符 |
+| ConnectionId | MySQL 连接 ID |
+| Catalog | Catalog 名称(如 `internal`、`hive_test`) |
+| Database | 数据库/模式名称 |
+| User | 提交查询的用户 |
+| ExecTime | 执行时长,单位毫秒 |
+| SqlHash | SQL 语句的 MD5 哈希值 |
+| Statement | SQL 语句文本(显示时可能被截断) |
+| ScanRows | 从存储层扫描的总行数 |
+| ScanBytes | 从存储层扫描的总字节数 |
+| ProcessRows | 经执行管道处理的行数。反映经过算子的实际数据量,可用于观察查询吞吐量 |
+| CpuMs | CPU 耗时,单位毫秒 |
+| MaxPeakMemoryBytes | 查询执行期间达到的内存峰值 |
+| CurrentUsedMemoryBytes | 查询当前正在使用的内存 |
+| WorkloadGroupId | 该查询所属的工作负载组 ID |
+| ShuffleSendBytes | 节点间数据 Shuffle 发送的总字节数 |
+| ShuffleSendRows | 节点间数据 Shuffle 发送的总行数 |
+| ScanBytesFromLocalStorage | 从本地磁盘存储扫描的字节数 |
+| ScanBytesFromRemoteStorage | 从远程存储(如 HDFS、S3)扫描的字节数 |
+| SpillWriteBytesToLocalStorage | 因内存压力溢写到本地磁盘的字节数 |
+| SpillReadBytesFromLocalStorage | 从本地磁盘溢写数据读回的字节数 |
+| BytesWriteIntoCache | 写入数据缓存的字节数 |
+| TotalTasks | 该查询的 Pipeline 任务总数 |
+| FinishedTasks | 已完成的 Pipeline 任务数 |
+| Progress | 查询执行进度百分比,计算公式为 `FinishedTasks / TotalTasks` |
+
+## REST API
+
+你也可以通过 HTTP REST API 获取当前正在运行的查询及其运行时统计信息:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/current_queries
+```
+
+该接口以 JSON 格式返回相同的列数据。
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "columnNames": [
+ "Frontend", "QueryId", "ConnectionId", "Catalog", "Database",
+ "User", "ExecTime", "SqlHash", "Statement",
+ "ScanRows", "ScanBytes", "ProcessRows", "CpuMs",
+ "MaxPeakMemoryBytes", "CurrentUsedMemoryBytes", "WorkloadGroupId",
+ "ShuffleSendBytes", "ShuffleSendRows",
+ "ScanBytesFromLocalStorage", "ScanBytesFromRemoteStorage",
+ "SpillWriteBytesToLocalStorage", "SpillReadBytesFromLocalStorage",
+ "BytesWriteIntoCache",
+ "TotalTasks", "FinishedTasks", "Progress"
+ ],
+ "rows": [
+ [
+ "172.19.0.3", "108e47ab438a4560-ab1651d16c036491", "2", "internal",
+ "testdb", "root", "6074",
+ "1a35f62f4b14b9d7961b057b77c3102f", "select sleep(60)",
+ "0", "0.00", "0", "0",
+ "0.00", "0.00", "0",
+ "0.00", "0",
+ "0.00", "0.00",
+ "0.00", "0.00",
+ "0.00",
+ "1", "1", "100%"
+ ]
+ ]
+ },
+ "count": 0
+}
+```
+
+### 查询参数
+
+- `is_all_node`:可选。若为 `true` 则返回所有 FE 节点上当前正在运行的查询。默认为 `true`。
+
+## 通过 Trace ID 实时追踪进度
+
+如需实时监控查询进度,可以在执行查询前设置 Trace ID,随后轮询统计信息接口:
+
+```sql
+SET session_context="trace_id:my_trace_id";
+SELECT ...;
+```
+
+然后通过另一个会话查询统计信息:
+
+```bash
+curl http://<fe_ip>:<fe_http_port>/rest/v2/manager/query/statistics/my_trace_id
+```
+
+返回结果包含任务进度和资源使用情况:
+
+```json
+{
+ "msg": "success",
+ "code": 0,
+ "data": {
+ "scanRows": 1102562592,
+ "scanBytes": 9878424780,
+ "returnedRows": 12345,
+ "processRows": 112176670,
+ "cpuMs": 53808,
+ "maxPeakMemoryBytes": 3355443200,
+ "currentUsedMemoryBytes": 2684354560,
+ "shuffleSendBytes": 0,
+ "shuffleSendRows": 0,
+ "scanBytesFromLocalStorage": 0,
+ "scanBytesFromRemoteStorage": 9878424780,
+ "spillWriteBytesToLocalStorage": 0,
+ "spillReadBytesFromLocalStorage": 0,
+ "bytesWriteIntoCache": 0,
+ "totalTasksNum": 138,
+ "finishedTasksNum": 65,
+ "progress": "47%"
+ },
+ "count": 0
+}
+```
+
+你可以定期调用此接口以实时追踪查询的进度。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
index f2f620c3b4d..25c86be00e5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/system-info-and-help/SHOW-PROC.md
@@ -70,8 +70,8 @@ mysql> show proc "/";
8. cluster_health : 通过 <code>SHOW PROC '/cluster_health/tablet_health'</code>; 命令可以查看整个集群的副本状态。
9. colocation_group : 该命令可以查看集群内已存在的 Group 信息,具体可以查看 [Colocation Join](../../../query-acceleration/colocation-join) 章节
10. current_backend_instances:显示当前正在执行作业的 be 节点列表
-11. current_queries : 查看正在执行的查询列表,当前正在运行的 SQL 语句。
-12. current_query_stmts : 返回当前正在执行的 query。
+11. current_queries : 查看正在执行的查询列表,包含运行时统计信息和任务进度(扫描/CPU/内存/Shuffle/溢写/缓存等指标)。自 4.1.1 起,该视图与 `current_query_stmts` 共享相同的增强统计信息。
+12. current_query_stmts : 返回当前正在执行的 query,与 `current_queries` 共享相同的统计视图,提供任务级别的进度和资源指标。
13. dbs:主要用于查看 Doris 集群中各个数据库以及其中的表的元数据信息。这些信息包括表结构、分区、物化视图、数据分片和副本等等。通过这个目录和其子目录,可以清楚的展示集群中的表元数据情况,以及定位一些如数据倾斜、副本故障等问题
14. diagnose : 报告和诊断集群中的常见管控问题,主要包括副本均衡和迁移、事务异常等
15. frontends:显示集群中所有的 FE 节点信息,包括 IP 地址、角色、状态、是否是 master 等,等同于 [SHOW FRONTENDS](../cluster-management/instance-management/SHOW-FRONTENDS)
diff --git a/sidebars-next.ts b/sidebars-next.ts
index 0504fd1d950..83be1f3840a 100644
--- a/sidebars-next.ts
+++ b/sidebars-next.ts
@@ -745,6 +745,7 @@ const sidebars: SidebarsConfig = {
'admin-manual/workload-management/concurrency-control-and-queuing',
'admin-manual/workload-management/spill-disk',
'admin-manual/workload-management/sql-blocking',
+ 'admin-manual/workload-management/query-progress-monitor',
'admin-manual/workload-management/kill-query',
'admin-manual/workload-management/job-scheduler',
],
diff --git a/sidebars.ts b/sidebars.ts
index 5e8eceb8dfc..b71b007ee23 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -780,6 +780,7 @@ const sidebars: SidebarsConfig = {
'admin-manual/workload-management/concurrency-control-and-queuing',
'admin-manual/workload-management/spill-disk',
'admin-manual/workload-management/sql-blocking',
+ 'admin-manual/workload-management/query-progress-monitor',
'admin-manual/workload-management/kill-query',
'admin-manual/workload-management/job-scheduler',
],
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org