pub struct ExecutionPlan {
pub root: Option<PlanNodeEnum>,
pub id: i64,
pub optimize_time_in_us: u64,
pub format: String,
pub partition_spec: Option<PartitionSpec>,
pub max_workers: usize,
pub max_buffered_chunks: usize,
pub parallel_fallback_reason: String,
pub cbo_notes: Vec<String>,
pub row_estimates: HashMap<i64, u64>,
pub join_algorithms: HashMap<i64, JoinAlgorithm>,
pub logical_plan: Option<LogicalPlan>,
}Expand description
Execution plan structure Represents the complete executable plan, including the root node and the plan ID.
Fields§
§root: Option<PlanNodeEnum>The root node of the planning tree
id: i64The unique ID of the plan
optimize_time_in_us: u64Optimized time (in microseconds)
format: StringOf course! Please provide the text you would like to have translated.
partition_spec: Option<PartitionSpec>Optional physical partition layout. A layout is consumed only by a partition-safe streaming plan; unsupported plans fail explicitly.
max_workers: usizeMaximum worker threads for intra-query parallelism. 1 means fully serial. Propagated from PartitioningConfig.
max_buffered_chunks: usizePer-partition output channel capacity for backpressure.
parallel_fallback_reason: StringWhy parallel partitioning was not selected (empty = partitioning active or not requested). Surfaced in EXPLAIN / PROFILE diagnostics.
cbo_notes: Vec<String>Cost-based decision notes produced during optimization (e.g. subquery unnesting and join-order rewrites). Surfaced in EXPLAIN diagnostics.
row_estimates: HashMap<i64, u64>Per-logical-node output row estimates produced by the cost-based
phase, keyed by logical node id. Written into physical operator
specs (estimated_cardinality) by the estimated_rows metadata pass.
join_algorithms: HashMap<i64, JoinAlgorithm>Cost-based join algorithm decisions keyed by planner node id.
Produced by the join-order rewriter when it reorders a join chain;
consumed by the arena builder to pick HashJoin vs nested-loop
execution for each InnerJoin/LeftJoin node. Absent keys fall
back to the default heuristic (hash join for valid equi keys).
logical_plan: Option<LogicalPlan>The pure logical plan (if conversion succeeded). Used by cost-based optimization to make physical decisions.
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
Sourcepub fn new(root: Option<PlanNodeEnum>) -> Self
pub fn new(root: Option<PlanNodeEnum>) -> Self
Create a new execution plan.
Sourcepub fn set_root(&mut self, root: PlanNodeEnum)
pub fn set_root(&mut self, root: PlanNodeEnum)
Set the root node of the plan.
Sourcepub fn root(&self) -> &Option<PlanNodeEnum>
pub fn root(&self) -> &Option<PlanNodeEnum>
Obtain the reference to the root node of the plan.
Sourcepub fn root_mut(&mut self) -> &mut Option<PlanNodeEnum>
pub fn root_mut(&mut self) -> &mut Option<PlanNodeEnum>
Obtain a reference to the variable root node.
Sourcepub fn set_optimize_time(&mut self, time_us: u64)
pub fn set_optimize_time(&mut self, time_us: u64)
Set the optimization time
Sourcepub fn set_format(&mut self, format: String)
pub fn set_format(&mut self, format: String)
Set the output format
Sourcepub fn set_partition_spec(&mut self, partition_spec: PartitionSpec)
pub fn set_partition_spec(&mut self, partition_spec: PartitionSpec)
Attach the physical partition layout chosen by the optimizer.
Sourcepub fn clear_partition_spec(&mut self)
pub fn clear_partition_spec(&mut self)
Remove partitioning and execute the plan as a single tree.
pub fn partition_spec(&self) -> Option<&PartitionSpec>
pub fn set_max_workers(&mut self, max_workers: usize)
pub fn set_max_buffered_chunks(&mut self, max_buffered_chunks: usize)
Sourcepub fn set_logical_plan(&mut self, logical_plan: LogicalPlan)
pub fn set_logical_plan(&mut self, logical_plan: LogicalPlan)
Attach a pure logical plan for cost-based optimization.
Sourcepub fn logical_plan(&self) -> Option<&LogicalPlan>
pub fn logical_plan(&self) -> Option<&LogicalPlan>
Access the logical plan, if available.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Calculate the number of nodes in the plan. Traverses the execution plan tree with an explicit stack instead of recursion so deeply nested plans cannot overflow the call stack.
Trait Implementations§
Source§impl Clone for ExecutionPlan
impl Clone for ExecutionPlan
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionPlan
impl !UnwindSafe for ExecutionPlan
impl Freeze for ExecutionPlan
impl Send for ExecutionPlan
impl Sync for ExecutionPlan
impl Unpin for ExecutionPlan
impl UnsafeUnpin for ExecutionPlan
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.