pub struct Plan {
pub stages: Vec<Stage>,
pub budget: Option<usize>,
pub refusals: Vec<String>,
}Expand description
What ran, in the order it ran.
Fields§
§stages: Vec<Stage>§budget: Option<usize>Set when the row budget let a stage stop before consuming its input.
refusals: Vec<String>Why the optimiser declined to push a predicate. Recorded rather than silent: you cannot tell “correctly refused” from “forgot to look” if the decision leaves no trace.
Implementations§
Source§impl Plan
impl Plan
pub fn push(&mut self, s: Stage)
Sourcepub fn joins(&self) -> Vec<&Stage>
pub fn joins(&self) -> Vec<&Stage>
The join stages, for callers that only care how joins were executed.
Keeps the differential tests and the benchmark reading the same report the plan is built from, rather than a second source of truth.
Sourcepub fn join_strategy(&self, n: usize) -> Option<Strategy>
pub fn join_strategy(&self, n: usize) -> Option<Strategy>
The strategy of the nth join, if there is one.
Sourcepub fn join_strategies(&self) -> Vec<Strategy>
pub fn join_strategies(&self) -> Vec<Strategy>
The strategy of every join, in execution order.
Sourcepub fn tree(&self) -> Option<PlanTree>
pub fn tree(&self) -> Option<PlanTree>
The pipeline as a tree. None when nothing ran (SELECT 1).
Stages are recorded as: the base scan, then per join its right-hand scan followed by the join itself, then the postfix stages. That shape is what makes the reconstruction unambiguous.
Sourcepub fn render(&self) -> Vec<String>
pub fn render(&self) -> Vec<String>
Render as EXPLAIN output: one string per line, innermost first, the
way PostgreSQL nests its plan tree.
The pipeline is linear, so indentation grows monotonically. A reader familiar with PostgreSQL’s output will read this correctly; a reader who is not still sees the order things happened in.
Trait Implementations§
impl Eq for Plan
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
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
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§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
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more