跳到主要内容

EXPLAIN FRAGMENTS

显示 SQL 语句的分布式执行计划。

此命令将 SQL 语句的执行计划转换为计划片段,您可以从中看到从 Databend 中检索所需数据的过程。

语法

EXPLAIN FRAGMENTS <statement>

示例

EXPLAIN FRAGMENTS select COUNT() from numbers(10) GROUP BY number % 3;

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| explain |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Fragment 0: |
| DataExchange: Shuffle |
| AggregatorPartial: groupBy=[[(number % 3)]], aggr=[[COUNT()]] |
| Expression: (number % 3):UInt8 (Before GroupBy) |
| ReadDataSource: scan schema: [number:UInt64], statistics: [read_rows: 10, read_bytes: 80, partitions_scanned: 1, partitions_total: 1], push_downs: [projections: [0]] |
| |
| Fragment 2: |
| DataExchange: Merge |
| Projection: COUNT():UInt64 |
| AggregatorFinal: groupBy=[[(number % 3)]], aggr=[[COUNT()]] |
| Remote[receive fragment: 0] |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
11 rows in set (0.02 sec)
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册