pub struct PushDownLimit {}Expand description
Optimization rule that tries to push down LIMIT.
It pushes LIMIT through projections, unions, joins and into scans
(taking the smaller limit when one is already present), merges adjacent
limits, and pushes a Sort carrying a fetch limit (a TopK) onto a join’s
preserved-side child so fewer rows enter the join. See
topk_through_join for the latter.
The TopK-through-join rewrite has an implicit ordering dependency on
push_down_filter and eliminate_outer_join: a Filter sitting between
the Sort and the Join blocks this rule (a Filter can’t sink below a
fetch-bearing node without changing which rows survive), and an outer
join only has a “preserved side” once eliminate_outer_join has already
dropped joins it can prove are equivalent to an inner join. Both of those
rules need a prior or concurrent pass to unblock this one; with
max_passes >= 2 this resolves on a later pass.
Implementations§
Source§impl PushDownLimit
impl PushDownLimit
Trait Implementations§
Source§impl Debug for PushDownLimit
impl Debug for PushDownLimit
Source§impl Default for PushDownLimit
impl Default for PushDownLimit
Source§impl OptimizerRule for PushDownLimit
Push down Limit.
impl OptimizerRule for PushDownLimit
Push down Limit.
Source§fn rewrite(
&self,
plan: LogicalPlan,
_config: &dyn OptimizerConfig,
) -> Result<Transformed<LogicalPlan>>
fn rewrite( &self, plan: LogicalPlan, _config: &dyn OptimizerConfig, ) -> Result<Transformed<LogicalPlan>>
plan to an optimized form, returning Transformed::yes
if the plan was rewritten and Transformed::no if it was not. Read moreSource§fn apply_order(&self) -> Option<ApplyOrder>
fn apply_order(&self) -> Option<ApplyOrder>
ApplyOrder for details. Read moreAuto Trait Implementations§
impl Forget for PushDownLimit
impl Freeze for PushDownLimit
impl Move for PushDownLimit
impl RefUnwindSafe for PushDownLimit
impl Send for PushDownLimit
impl Sync for PushDownLimit
impl Unpin for PushDownLimit
impl UnsafeUnpin for PushDownLimit
impl UnwindSafe for PushDownLimit
Blanket Implementations§
impl<T> Allocation for T
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> 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