pub struct JoinMeta {
pub strategy: JoinStrategy,
pub produced_row_count_estimate: u64,
pub own_push_removed_row_count_estimate: u64,
pub star_arms: Option<u8>,
pub semi_gate: Option<SemiGateFacts>,
}Expand description
Planner annotations on an inner join (costing / execution hints).
Structural join keys live on PlanNode::Join; this holds strategy and
two row-estimate frames — produced (all pushes active at the node) and
own_push_removed (this join’s own probe push removed) — not a peer of
ScanOp. See the field docs for the frame table and the one-level
limitation of the own-push-removed record.
Fields§
§strategy: JoinStrategyBroadcast / shuffle / hash hint from cardinality estimates.
produced_row_count_estimate: u64Rows this join is planned to produce, stamped in two phases:
-
During the
refinalize_joinsrounds, [finalize_inner_join_meta] writes the uniform estimate. A path operand joined on one of its ends is already priced push-aware here (path_probe_row_bound): a bind-join probe returns the values-broadcast bound, not its unbound leaf price, and the swap comparator’s row tiebreak must see the executed size or it seats the wrong driver. Structural decisions consume exactly this number: the swap comparator’s row tiebreak and every ancestor join’s own product. -
After the last [
restamp_broadcast_marks], [restamp_joins_produced_row_count_estimate] overwrites it push-aware: a join key whose runtime push is stamped on a probe scan divides by the driver-side domain alone (the push guarantees the key matches;max(dom_L, dom_R)was the pre-push containment bound), and row counts are the settled post-clamp values. The final tree’s number reflects the pushes actually planned.
Frame: every push active at this node — the join’s own probe
push, pushes owned by joins inside either arm, and pushes arriving
from ancestors above this join. This is the row count the executor’s
stream is expected to carry under the planned pushes, and the number
seating, ancestor products, and the fetch-once page basis consume.
The counterfactual with this join’s own probe push removed is
Self::own_push_removed_row_count_estimate; the two are not
interchangeable.
own_push_removed_row_count_estimate: u64The uniform estimate with this join’s own probe push removed:
the rows this join would emit if it did not push its driver keys
into its right arm, while keeping pushes owned by joins inside
either arm and pushes from ancestors above this join. EXPLAIN shows
it as (price ~N) beside the produced count.
Frame, not a general no-push estimate. A child’s value is not a
valid input for a parent’s own-push-removed estimate: the child
removed its push, which is still active when the parent probes it.
A parent-frame estimate (“remove P’s push, keep N’s own”) needs
clamp provenance this field does not carry. A fully unpushed
estimate is a third frame, derived on demand by
[unpushed_row_count_estimate] / [unpushed_read_rows], never
stored here.
Current implementation is one level deep.
finalize_inner_join_meta re-derives only a direct right-arm path
or claimed scan (path_arm_own_push_removed_price); a non-path right subtree
and the entire left arm pass through their produced cells. A
non-path child may already carry a clamp from a deeper join or an
ancestor (the refinalize_joins rounds re-stamp from the settled
cells), so this field can equal the produced count even though the
frame says otherwise.
Consumers: EXPLAIN and
PlanNode::own_push_removed_row_count_estimate. The latter is the
coverage-drop / concurrent-star driver upper bound: a larger
driver estimate makes a covered-push drop less likely, which is the
conservative direction. Seating and fetch-once do not read it.
Written alongside Self::produced_row_count_estimate at finalize
and never overwritten by the restamp.
star_arms: Option<u8>Star-spine membership: Some(arm_count) on the HEAD join of a spine
the executor’s concurrent-star detect admits under eager-path
parameters (slice_path = false, eager_star_page_rows()); None
on every other join (spine members, chains, non-joins). Sole writer:
[stamp_star_join_shapes], which runs after the LAST seating round
— nothing structural follows it, so the stamp cannot go stale and
needs no clear pass (unlike broadcasted, which refinalize swaps
must clear). Display-and-pricing annotation only: EXPLAIN renders
the star shape from it and the fetch-once verdict’s batch credit
reads its arm count from it; the executor still runs
its own detect (runtime structures must be assembled there) and
debug-asserts agreement on the eager path. The slice path
(OpenNode) may legitimately run a star this stamp does not name:
its viability gate prices demand-bounded pages, which plan time
cannot reproduce.
semi_gate: Option<SemiGateFacts>The liveness-dependent semi gate facts, recorded by the final
liveness round for a general-Semi candidate. None means the join
was not recorded (not a candidate, or the round did not run);
[stamp_semi_join_strategy] consumes the record.
Trait Implementations§
impl Copy for JoinMeta
impl Eq for JoinMeta
impl StructuralPartialEq for JoinMeta
Auto Trait Implementations§
impl Freeze for JoinMeta
impl RefUnwindSafe for JoinMeta
impl Send for JoinMeta
impl Sync for JoinMeta
impl Unpin for JoinMeta
impl UnsafeUnpin for JoinMeta
impl UnwindSafe for JoinMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].