pub struct StatisticsContext { /* private fields */ }Expand description
Owns the bottom-up traversal and per-walk memoization cache for statistics
computation. Call StatisticsContext::compute to walk a plan tree.
Implementations§
Source§impl StatisticsContext
impl StatisticsContext
Sourcepub fn reset_cache(&self)
pub fn reset_cache(&self)
Clears the memoization cache.
The cache is keyed by raw plan-node pointers, which are only stable while the current plan tree is alive. Reset between optimizer passes (which rewrite the plan) when reusing one context across them, so stale pointer keys cannot collide.
Sourcepub fn compute(
&self,
plan: &dyn ExecutionPlan,
args: &StatisticsArgs,
) -> Result<Arc<Statistics>>
pub fn compute( &self, plan: &dyn ExecutionPlan, args: &StatisticsArgs, ) -> Result<Arc<Statistics>>
Computes statistics for plan, resolving children first and passing
the results to ExecutionPlan::statistics_from_inputs.
When args.partition() is Some(idx), idx is validated against the
plan’s partition count.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StatisticsContext
impl !Send for StatisticsContext
impl !Sync for StatisticsContext
impl !UnwindSafe for StatisticsContext
impl Freeze for StatisticsContext
impl Unpin for StatisticsContext
impl UnsafeUnpin for StatisticsContext
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> 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