Skip to main content

Provenance

Enum Provenance 

Source
pub enum Provenance {
Show 15 variants RowCount, ZoneMap, NullCount, Sketch, FrequencySynopsis, Quantiles, Dictionary, Sortedness, Distinctness, LinkHeader, DegreeDistribution, Sample, Default, Observed, Propagation,
}
Expand description

What produced an answer.

Printed by EXPLAIN next to the class, so these are the words a person reads when a plan went wrong. It names the source rather than the value, and it is carried by exact answers as well as by guesses, because an exact count out of a catalog and an exact join cardinality out of a link header want different follow up questions when one of them turns out to be stale.

The list is spec/stats/02-the-catalogue.md section 2.1.1’s fourteen plus Self::Propagation, which the specification does not name because it is not a source of data. It is what a number derived from two others says about itself, and leaving it out would mean a combination inherited the provenance of whichever operand happened to be on the left.

Variants§

§

RowCount

A maintained row count. Exact.

§

ZoneMap

A minimum and a maximum, either answered from or interpolated between.

§

NullCount

A maintained null count. Exact.

§

Sketch

A distinct-count sketch.

Carried by both classes, because a bottom-k sketch that has not filled up is holding every hash it was given and the count it gives back is the count. So this arrives as Exact for a column with few enough distinct values and Estimated for one with more, and the class is where that difference is written rather than here.

§

FrequencySynopsis

A frequency synopsis, with or without its certificate discharged.

§

Quantiles

A quantile summary.

§

Dictionary

A dictionary’s size, standing in for or answering a distinct count.

§

Sortedness

A persisted sortedness flag.

§

Distinctness

A persisted distinctness flag.

§

LinkHeader

The four numbers in a relationship’s link header, or a cardinality derived from them. Exact, and the most valuable kind of exact there is, because join cardinality is where every cost model in the literature goes wrong by orders of magnitude.

§

DegreeDistribution

A relationship’s degree distribution.

§

Sample

The stored sample.

§

Default

A constant in the source. The weakest answer that is not Unknown, and the one worth searching an EXPLAIN for, because it means nobody had a number at that node at all.

§

Observed

Something a previous execution measured, out of the observation log. Kept apart from every other variant here on purpose: the rest are facts about the file and this one is a fact about history.

§

Propagation

A rule applied over two other answers. Not a source of data, and the honest thing to say about a number that was derived rather than read.

Implementations§

Source§

impl Provenance

Source

pub const fn name(self) -> &'static str

The word EXPLAIN prints.

Source

pub const fn is_observed(self) -> bool

Whether this is a fact about a previous execution rather than about the file.

The one question a consumer of spec/stats/06-the-reward.md’s tier 1 corrections has to be able to ask, because an observation is Exact only for the generation it was taken on.

Trait Implementations§

Source§

impl Clone for Provenance

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 Copy for Provenance

Source§

impl Debug for Provenance

Source§

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

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

impl Display for Provenance

Source§

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

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

impl Eq for Provenance

Source§

impl Hash for Provenance

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Provenance

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 Provenance

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.