Apache DataFusion SQL Query Engine
docs: reorder - tree format (default) (#15706)
kosiew63f37a344043
diff --git a/docs/source/user-guide/sql/explain.md b/docs/source/user-guide/sql/explain.mdindex f89e854ebf..39d42f1c49 100644--- a/docs/source/user-guide/sql/explain.md+++ b/docs/source/user-guide/sql/explain.md@@ -39,39 +39,7 @@ the format from the [configuration value] `datafusion.explain.format`.[configuration value]: ../configs.md-### `indent` format (default)--The `indent` format shows both the logical and physical plan, with one line for-each operator in the plan. Child plans are indented to show the hierarchy.--See [Reading Explain Plans](../explain-usage.md) for more information on how to interpret these plans.--```sql-> CREATE TABLE t(x int, b int) AS VALUES (1, 2), (2, 3);-0 row(s) fetched.-Elapsed 0.004 seconds.--> EXPLAIN SELECT SUM(x) FROM t GROUP BY b;-+---------------+-------------------------------------------------------------------------------+-| plan_type | plan |-+---------------+-------------------------------------------------------------------------------+-| logical_plan | Projection: sum(t.x) |-| | Aggregate: groupBy=[[t.b]], aggr=[[sum(CAST(t.x AS Int64))]] |-| | TableScan: t projection=[x, b] |-| physical_plan | ProjectionExec: expr=[sum(t.x)@1 as sum(t.x)] |-| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[sum(t.x)] |-| | CoalesceBatchesExec: target_batch_size=8192 |-| | RepartitionExec: partitioning=Hash([b@0], 16), input_partitions=16 |-| | RepartitionExec: partitioning=RoundRobinBatch(16), input_partitions=1 |-| | AggregateExec: mode=Partial, gby=[b@1 as b], aggr=[sum(t.x)] |-| | DataSourceExec: partitions=1, partition_sizes=[1] |-| | |-+---------------+-------------------------------------------------------------------------------+-2 row(s) fetched.-Elapsed 0.004 seconds.-```--### `tree` format+### `tree` format (default)The `tree` format is modeled after [DuckDB plans] and is designed to be easierto see the high level structure of the plan@@ -138,6 +106,38 @@ to see the high level structure of the planElapsed 0.016 seconds.```+### `indent` format++The `indent` format shows both the logical and physical plan, with one line for+each operator in the plan. Child plans are indented to show the hierarchy.++See [Reading Explain Plans](../explain-usage.md) for more information on how to interpret these plans.++```sql+> CREATE TABLE t(x int, b int) AS VALUES (1, 2), (2, 3);+0 row(s) fetched.+Elapsed 0.004 seconds.++> EXPLAIN SELECT SUM(x) FROM t GROUP BY b;++---------------+-------------------------------------------------------------------------------++| plan_type | plan |++---------------+-------------------------------------------------------------------------------++| logical_plan | Projection: sum(t.x) |+| | Aggregate: groupBy=[[t.b]], aggr=[[sum(CAST(t.x AS Int64))]] |+| | TableScan: t projection=[x, b] |+| physical_plan | ProjectionExec: expr=[sum(t.x)@1 as sum(t.x)] |+| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[sum(t.x)] |+| | CoalesceBatchesExec: target_batch_size=8192 |+| | RepartitionExec: partitioning=Hash([b@0], 16), input_partitions=16 |+| | RepartitionExec: partitioning=RoundRobinBatch(16), input_partitions=1 |+| | AggregateExec: mode=Partial, gby=[b@1 as b], aggr=[sum(t.x)] |+| | DataSourceExec: partitions=1, partition_sizes=[1] |+| | |++---------------+-------------------------------------------------------------------------------++2 row(s) fetched.+Elapsed 0.004 seconds.+```+### `pgjson` formatThe `pgjson` format is modeled after [Postgres JSON] format.