Skip to main content

HeatAwareLeaderModel

Struct HeatAwareLeaderModel 

Source
pub struct HeatAwareLeaderModel;
Expand description

Heat-aware cost model: combines cardinality, access heat, and observed join selectivity into a fixed composite score formula. Higher score = more expensive to iterate over → demote from the leader (slot 0). The model picks argmin(score) as leader, gated by the same effective_wcoj_var_ordering_threshold as the leader-cardinality model.

Composite score formula:

score(rel) = cardinality(rel)
           * (1.0 + 4.0 * heat(rel))
           * Σ_{e ∈ edges(rel)} 1.0 / max(0.01, observed_sel_or_one(e))
  • cardinality from StatsManager::get_relation_stats(rel).cardinality.
  • heat from RelationStats.heat: f32 (EMA written by record_access at node_dispatch.rs:26).
  • observed_sel_or_one(e) from StatsManager::get_join_selectivity(rel_a, rel_b) (join-result feedback via record_join_result, EMA-smoothed). Key-validation: only consume a cached JoinSelectivity when its (left_keys, right_keys) match the candidate edge keys after StatsManager::canonical_join_key swap. On mismatch, default to 1.0 (no observed filter assumption).

Heat weight 4.0: with default threshold 0.5, gate fires when min/default ≤ 0.5. With cards equal + heat = h on the hot rel, ratio = 1 / (1 + 4h). For 1 + 4h ≥ 2.0h ≥ 0.25 (~3 record_access calls).

Implementations§

Source§

impl HeatAwareLeaderModel

Source

pub const HEAT_WEIGHT: f32 = 4.0

Heat weight used by the composite score formula.

Source

pub const NO_OBSERVED_SEL: f64 = 1.0

Default selectivity for an edge with no observed JoinSelectivity record (or with mismatched keys).

Source

pub const SEL_FLOOR: f64 = 0.01

Floor used in 1/max(0.01, sel) to avoid divide-by-zero on tightly observed edges.

Trait Implementations§

Source§

impl Clone for HeatAwareLeaderModel

Source§

fn clone(&self) -> HeatAwareLeaderModel

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 HeatAwareLeaderModel

Source§

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

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

impl Default for HeatAwareLeaderModel

Source§

fn default() -> HeatAwareLeaderModel

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

impl WcojVariableOrderingModel for HeatAwareLeaderModel

Source§

fn pick_triangle_leader( &self, rel_ids: [RelId; 3], stats: &StatsManager, config: &CompilerConfig, ) -> Option<u8>

Pick a leader for the triangle WCOJ shape. Read more
Source§

fn pick_4cycle_leader( &self, rel_ids: [RelId; 4], stats: &StatsManager, config: &CompilerConfig, ) -> Option<u8>

Pick a leader for the 4-cycle WCOJ shape. Read more
Source§

impl Copy for HeatAwareLeaderModel

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 = 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<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,