Skip to main content

EXPLAIN FRAGMENTS

Shows the distributed execution plan of an SQL statement.

This command transforms the execution plan of an SQL statement into plan fragments where you can see the process of retrieving the data you need from Databend.

Syntax

EXPLAIN FRAGMENTS <statement>

Examples

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)