pub struct OptimizeAggregateOrder {}
Expand description
This optimizer rule checks ordering requirements of aggregate expressions.
There are 3 kinds of aggregators in terms of ordering requirements:
AggregateOrderSensitivity::Insensitive
, meaning that ordering is not important.AggregateOrderSensitivity::HardRequirement
, meaning that the aggregator requires a specific ordering.AggregateOrderSensitivity::Beneficial
, meaning that the aggregator can handle unordered input, but can run more efficiently if its input conforms to a specific ordering.
This rule analyzes aggregate expressions of type Beneficial
to see whether
their input ordering requirements are satisfied. If this is the case, the
aggregators are modified to run in a more efficient mode.
Implementations§
Trait Implementations§
Source§impl Debug for OptimizeAggregateOrder
impl Debug for OptimizeAggregateOrder
Source§impl Default for OptimizeAggregateOrder
impl Default for OptimizeAggregateOrder
Source§fn default() -> OptimizeAggregateOrder
fn default() -> OptimizeAggregateOrder
Returns the “default value” for a type. Read more
Source§impl PhysicalOptimizerRule for OptimizeAggregateOrder
impl PhysicalOptimizerRule for OptimizeAggregateOrder
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>>
Applies the OptimizeAggregateOrder
rule to the provided execution plan.
This function traverses the execution plan tree, identifies AggregateExec
nodes,
and optimizes their aggregate expressions based on existing input orderings.
If optimizations are applied, it returns a modified execution plan.
§Arguments
plan
- The root of the execution plan to optimize._config
- Configuration options (currently unused).
§Returns
A Result
containing the potentially optimized execution plan or an error.
Source§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
A flag to indicate whether the physical planner should valid 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 OptimizeAggregateOrder
impl RefUnwindSafe for OptimizeAggregateOrder
impl Send for OptimizeAggregateOrder
impl Sync for OptimizeAggregateOrder
impl Unpin for OptimizeAggregateOrder
impl UnwindSafe for OptimizeAggregateOrder
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