Skip to main content

Class

Enum Class 

Source
pub enum Class {
    Exact,
    Certified {
        bound: f64,
    },
    Estimated {
        source: Source,
    },
}
Expand description

How much of an answer is knowledge.

Three cases, ordered by how much they permit. Exact permits anything, including changing an answer by folding a predicate away. Certified permits a decision whose fallback survives being wrong, which is the case a safe bound is for. Estimated permits choosing between two plans that produce the same rows, and nothing else.

Variants§

§

Exact

The value is the value. A count that was counted, a null count that was maintained, a minimum that was compared.

§

Certified

The value is wrong by no more than bound, as a fraction of itself, and the structure that produced it can prove that.

A quantile summary with an epsilon is the usual source. The number is what makes a threshold safe to seed from, so a producer that cannot state one should say Estimated instead of picking a bound that sounds about right.

Fields

§bound: f64

The relative error bound, where 0.01 is one percent.

§

Estimated

The value is a guess, and this is where it came from.

Fields

§source: Source

What produced the guess, because EXPLAIN prints it.

Implementations§

Source§

impl Class

Source

pub const fn is_exact(self) -> bool

Whether this is knowledge rather than a guess, which is the test the folding rule applies.

Source

pub fn combine(self, other: Self) -> Self

The class of an answer computed from two others.

Exact combined with anything else is the anything else, which is the honest direction and the easy one to get backwards. Two certified bounds add, because a combination of two bounded errors is bounded by their sum, and the sum saturates at one because a bound of more than a hundred percent says nothing that Estimated does not say. Anything involving an estimate is an estimate, and the source of a combination is Source::Propagation unless one of the two was a bare constant, in which case the answer is as weak as the constant was.

Trait Implementations§

Source§

impl Clone for Class

Source§

fn clone(&self) -> Class

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 Class

Source§

impl Debug for Class

Source§

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

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

impl Display for Class

Source§

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

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

impl PartialEq for Class

Source§

fn eq(&self, other: &Class) -> 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 Class

Auto Trait Implementations§

§

impl Freeze for Class

§

impl RefUnwindSafe for Class

§

impl Send for Class

§

impl Sync for Class

§

impl Unpin for Class

§

impl UnsafeUnpin for Class

§

impl UnwindSafe for Class

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.