PushLimitIntoSource implements Rule
Read onlyYes
FinalYes
Interfaces
Methods
- apply() : LogicalPlan
- One walk per consumer, pushed only when EVERY walk reaches the source: a limit collected from one consumer must not narrow what another consumer of the same source reads, so the widest one is pushed.
- limitAt() : null|int
- The limit ONE root lets through to $leaf. Limits fold with min(); a node that is not preserving or not transparent DISCARDS what was collected above it and the walk continues, so read->limit(5)->sort()->limit(3) still yields 5. An Offset grows the limit by the rows it skips, so read->offset(100)->limit(10) yields 110.
Methods
apply()
One walk per consumer, pushed only when EVERY walk reaches the source: a limit collected from one consumer must not narrow what another consumer of the same source reads, so the widest one is pushed.
public
apply(LogicalPlan $plan, Backend $backend) : LogicalPlan
Parameters
- $plan : LogicalPlan
- $backend : Backend
Return values
LogicalPlanlimitAt()
The limit ONE root lets through to $leaf. Limits fold with min(); a node that is not preserving or not transparent DISCARDS what was collected above it and the walk continues, so read->limit(5)->sort()->limit(3) still yields 5. An Offset grows the limit by the rows it skips, so read->offset(100)->limit(10) yields 110.
public
limitAt(Node $from, Read $leaf) : null|int
Parameters
Return values
null|int —null when no limit survives, and when this chain does not reach $leaf at all