pub enum ExplainFormat {
Indent,
Tree,
PostgresJSON,
Graphviz,
}
Expand description
Output formats for controlling for Explain plans
Variants§
Indent
Indent mode
Example:
> explain format indent select x from values (1) t(x);
+---------------+-----------------------------------------------------+
| plan_type | plan |
+---------------+-----------------------------------------------------+
| logical_plan | SubqueryAlias: t |
| | Projection: column1 AS x |
| | Values: (Int64(1)) |
| physical_plan | ProjectionExec: expr=[column1@0 as x] |
| | DataSourceExec: partitions=1, partition_sizes=[1] |
| | |
+---------------+-----------------------------------------------------+
Tree
Tree mode
Example:
> explain format tree select x from values (1) t(x);
+---------------+-------------------------------+
| plan_type | plan |
+---------------+-------------------------------+
| physical_plan | ┌───────────────────────────┐ |
| | │ ProjectionExec │ |
| | │ -------------------- │ |
| | │ x: column1@0 │ |
| | └─────────────┬─────────────┘ |
| | ┌─────────────┴─────────────┐ |
| | │ DataSourceExec │ |
| | │ -------------------- │ |
| | │ bytes: 128 │ |
| | │ format: memory │ |
| | │ rows: 1 │ |
| | └───────────────────────────┘ |
| | |
+---------------+-------------------------------+
PostgresJSON
Postgres Json mode
A displayable structure that produces plan in postgresql JSON format.
Users can use this format to visualize the plan in existing plan visualization tools, for example dalibo
Example:
> explain format pgjson select x from values (1) t(x);
+--------------+--------------------------------------+
| plan_type | plan |
+--------------+--------------------------------------+
| logical_plan | [ |
| | { |
| | "Plan": { |
| | "Alias": "t", |
| | "Node Type": "Subquery", |
| | "Output": [ |
| | "x" |
| | ], |
| | "Plans": [ |
| | { |
| | "Expressions": [ |
| | "column1 AS x" |
| | ], |
| | "Node Type": "Projection", |
| | "Output": [ |
| | "x" |
| | ], |
| | "Plans": [ |
| | { |
| | "Node Type": "Values", |
| | "Output": [ |
| | "column1" |
| | ], |
| | "Plans": [], |
| | "Values": "(Int64(1))" |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | ] |
+--------------+--------------------------------------+
Graphviz
Graphviz mode
Example:
> explain format graphviz select x from values (1) t(x);
+--------------+------------------------------------------------------------------------+
| plan_type | plan |
+--------------+------------------------------------------------------------------------+
| logical_plan | |
| | // Begin DataFusion GraphViz Plan, |
| | // display it online here: https://dreampuf.github.io/GraphvizOnline |
| | |
| | digraph { |
| | subgraph cluster_1 |
| | { |
| | graph[label="LogicalPlan"] |
| | 2[shape=box label="SubqueryAlias: t"] |
| | 3[shape=box label="Projection: column1 AS x"] |
| | 2 -> 3 [arrowhead=none, arrowtail=normal, dir=back] |
| | 4[shape=box label="Values: (Int64(1))"] |
| | 3 -> 4 [arrowhead=none, arrowtail=normal, dir=back] |
| | } |
| | subgraph cluster_5 |
| | { |
| | graph[label="Detailed LogicalPlan"] |
| | 6[shape=box label="SubqueryAlias: t\nSchema: [x:Int64;N]"] |
| | 7[shape=box label="Projection: column1 AS x\nSchema: [x:Int64;N]"] |
| | 6 -> 7 [arrowhead=none, arrowtail=normal, dir=back] |
| | 8[shape=box label="Values: (Int64(1))\nSchema: [column1:Int64;N]"] |
| | 7 -> 8 [arrowhead=none, arrowtail=normal, dir=back] |
| | } |
| | } |
| | // End DataFusion GraphViz Plan |
| | |
+--------------+------------------------------------------------------------------------+
Trait Implementations§
Source§impl Clone for ExplainFormat
impl Clone for ExplainFormat
Source§fn clone(&self) -> ExplainFormat
fn clone(&self) -> ExplainFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExplainFormat
impl Debug for ExplainFormat
Source§impl FromStr for ExplainFormat
Implement parsing strings to ExplainFormat
impl FromStr for ExplainFormat
Implement parsing strings to ExplainFormat
Source§impl Hash for ExplainFormat
impl Hash for ExplainFormat
Source§impl PartialEq for ExplainFormat
impl PartialEq for ExplainFormat
impl Eq for ExplainFormat
impl StructuralPartialEq for ExplainFormat
Auto Trait Implementations§
impl Freeze for ExplainFormat
impl RefUnwindSafe for ExplainFormat
impl Send for ExplainFormat
impl Sync for ExplainFormat
impl Unpin for ExplainFormat
impl UnwindSafe for ExplainFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more