pub struct EnforceSorting {}Expand description
This rule inspects SortExec’s in the given physical plan in order to
remove unnecessary sorts, and optimize sort performance across the plan.
Implementations§
Trait Implementations§
Source§impl Debug for EnforceSorting
impl Debug for EnforceSorting
Source§impl Default for EnforceSorting
impl Default for EnforceSorting
Source§fn default() -> EnforceSorting
fn default() -> EnforceSorting
Returns the “default value” for a type. Read more
Source§impl PhysicalOptimizerRule for EnforceSorting
Performs optimizations based upon a series of subrules.
Refer to each subrule for detailed descriptions of the optimizations performed:
Subrule application is ordering dependent.
impl PhysicalOptimizerRule for EnforceSorting
Performs optimizations based upon a series of subrules. Refer to each subrule for detailed descriptions of the optimizations performed: Subrule application is ordering dependent.
Optimizer consists of 5 main parts which work sequentially
ensure_sortingWorks down-to-top to be able to remove unnecessarySortExecs,SortPreservingMergeExecs addSortExecs if necessary by a requirement and adjusts window operators.parallelize_sorts(Optional, depends on therepartition_sortsconfiguration) Responsible to identify and remove unnecessary partition unifier operators such asSortPreservingMergeExec,CoalescePartitionsExecfollowsSortExecs does possible simplifications.replace_with_order_preserving_variants()Replaces with alternative operators, for example can merge aSortExecand aCoalescePartitionsExecinto oneSortPreservingMergeExecor aSortExec+RepartitionExeccombination into an order preservingRepartitionExecsort_pushdownWorks top-down. Responsible to push down sort operators as deep as possible in the plan.replace_with_partial_sortChecks if it’s possible to replaceSortExecs withPartialSortExecoperators
Source§fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize( &self, plan: Arc<dyn ExecutionPlan>, config: &ConfigOptions, ) -> Result<Arc<dyn ExecutionPlan>>
Rewrite
plan to an optimized formSource§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
A flag to indicate whether the physical planner should validate that the rule will not
change the schema of the plan after the rewriting.
Some of the optimization rules might change the nullable properties of the schema
and should disable the schema check.
Auto Trait Implementations§
impl Freeze for EnforceSorting
impl RefUnwindSafe for EnforceSorting
impl Send for EnforceSorting
impl Sync for EnforceSorting
impl Unpin for EnforceSorting
impl UnwindSafe for EnforceSorting
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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