Skip to main content

PlannedSource

Struct PlannedSource 

Source
pub struct PlannedSource {
    pub cost: f64,
    pub rows: f64,
    pub id: usize,
    pub table: TableInfo,
    pub alias: Vec<u8>,
    pub path: AccessPath,
    pub join: JoinKind,
    pub on: Option<BoundExpr>,
    pub on_enforced: bool,
}
Expand description

One FROM term with the path chosen for it.

Fields§

§cost: f64

What the planner estimated this term’s path would cost.

It is kept so that a test can assert on the reason a plan was chosen rather than only on the plan, which is the difference between catching a cost-model regression and catching it two releases later.

§rows: f64

How many rows the path is estimated to produce.

§id: usize

The statement-wide number every bound expression refers to it by.

§table: TableInfo

The table.

§alias: Vec<u8>

The name the query calls it.

§path: AccessPath

How its rows are produced.

§join: JoinKind

The join that attached it to the term before it.

§on: Option<BoundExpr>

The ON condition, when the join is an outer one.

An inner join’s condition is an ordinary predicate and is distributed with the rest; an outer join’s is not, because a row that fails it is still emitted, null-extended. Keeping it here rather than in the residual list is what stops the two being confused.

§on_enforced: bool

Whether the path this term is read by enforces the whole ON condition.

What decides whether an outer join can be an index nested loop. That operator probes the inner tree by a key and null-extends when the probe finds nothing; it has nowhere to test a condition the key did not capture, so it may only be used when there is nothing left to test. When the key is the whole condition - which ON b.k = a.k over an index on b(k) is - the probe’s answer and the condition’s answer are the same answer.

False for every inner join, where the condition is distributed into the statement’s terms and re-tested as a residual, and false for an outer join whose condition says more than its key does.

Trait Implementations§

Source§

impl Clone for PlannedSource

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PlannedSource

Source§

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

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

impl PartialEq for PlannedSource

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PlannedSource

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.