Skip to main content

IndexStats

Struct IndexStats 

Source
pub struct IndexStats<O: Eq + Hash> {
    pub op_card: HashMap<O, usize>,
    pub fanouts: FanOuts<O>,
    pub atom_card: HashMap<usize, usize>,
}

Fields§

§op_card: HashMap<O, usize>

Per-op driver-scan cardinality (|by_op[op]|). The base estimate for an atom when no per-atom override is present — correct for naive matching, where every atom of an op reads the same full bucket.

§fanouts: FanOuts<O>

Measured mean fan-out of each access path, from the round’s index build. The default is all-unmeasured, which prices every bound key at the fixed halving this model replaces; see path_selectivity.

§atom_card: HashMap<usize, usize>

Per-atom (atom_id) driver-scan cardinality, overriding op_card for that atom. Needed for semi-naive: an atom’s base cardinality is set by its mode (delta / full / full∖delta), which is per-atom, not per-op — two atoms with the same op can have different modes in one flavor (e.g. (f (f x y) z) variant 1: atom 0 is full∖delta, atom 1 is delta, both op f). op_card cannot represent that; atom_card can.

Implementations§

Source§

impl<O: Eq + Hash> IndexStats<O>

Source

pub fn new() -> Self

Source§

impl<O: Eq + Hash + Copy> IndexStats<O>

Source

pub fn from_index<Cfg>(index: &IndexStore<Cfg>) -> Self
where Cfg: EGraphConfig<O = O>, MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Trait Implementations§

Source§

impl<O: Eq + Hash> Default for IndexStats<O>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<O> Freeze for IndexStats<O>
where HashMap<O, usize>: Freeze, FanOuts<O>: Freeze,

§

impl<O> RefUnwindSafe for IndexStats<O>

§

impl<O> Send for IndexStats<O>
where HashMap<O, usize>: Send, FanOuts<O>: Send,

§

impl<O> Sync for IndexStats<O>
where HashMap<O, usize>: Sync, FanOuts<O>: Sync,

§

impl<O> Unpin for IndexStats<O>
where HashMap<O, usize>: Unpin, FanOuts<O>: Unpin,

§

impl<O> UnsafeUnpin for IndexStats<O>

§

impl<O> UnwindSafe for IndexStats<O>

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> 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, 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.