Skip to main content

JoinMeta

Struct JoinMeta 

Source
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: JoinStrategy

Broadcast / shuffle / hash hint from cardinality estimates.

§produced_row_count_estimate: u64

Rows this join is planned to produce, stamped in two phases:

  1. During the refinalize_joins rounds, [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.

  2. 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: u64

The 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§

Source§

impl Clone for JoinMeta

Source§

fn clone(&self) -> JoinMeta

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JoinMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for JoinMeta

Source§

fn eq(&self, other: &JoinMeta) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for JoinMeta

Source§

impl Eq for JoinMeta

Source§

impl StructuralPartialEq for JoinMeta

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,