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))cardinalityfromStatsManager::get_relation_stats(rel).cardinality.heatfromRelationStats.heat: f32(EMA written byrecord_accessatnode_dispatch.rs:26).observed_sel_or_one(e)fromStatsManager::get_join_selectivity(rel_a, rel_b)(join-result feedback viarecord_join_result, EMA-smoothed). Key-validation: only consume a cachedJoinSelectivitywhen its(left_keys, right_keys)match the candidate edge keys afterStatsManager::canonical_join_keyswap. On mismatch, default to1.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.0 → h ≥ 0.25
(~3 record_access calls).
Implementations§
Source§impl HeatAwareLeaderModel
impl HeatAwareLeaderModel
Sourcepub const HEAT_WEIGHT: f32 = 4.0
pub const HEAT_WEIGHT: f32 = 4.0
Heat weight used by the composite score formula.
Sourcepub const NO_OBSERVED_SEL: f64 = 1.0
pub const NO_OBSERVED_SEL: f64 = 1.0
Default selectivity for an edge with no observed
JoinSelectivity record (or with mismatched keys).
Trait Implementations§
Source§impl Clone for HeatAwareLeaderModel
impl Clone for HeatAwareLeaderModel
Source§fn clone(&self) -> HeatAwareLeaderModel
fn clone(&self) -> HeatAwareLeaderModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeatAwareLeaderModel
impl Debug for HeatAwareLeaderModel
Source§impl Default for HeatAwareLeaderModel
impl Default for HeatAwareLeaderModel
Source§fn default() -> HeatAwareLeaderModel
fn default() -> HeatAwareLeaderModel
Returns the “default value” for a type. Read more
Source§impl WcojVariableOrderingModel for HeatAwareLeaderModel
impl WcojVariableOrderingModel for HeatAwareLeaderModel
Source§fn pick_triangle_leader(
&self,
rel_ids: [RelId; 3],
stats: &StatsManager,
config: &CompilerConfig,
) -> Option<u8>
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>
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
impl Copy for HeatAwareLeaderModel
Auto Trait Implementations§
impl Freeze for HeatAwareLeaderModel
impl RefUnwindSafe for HeatAwareLeaderModel
impl Send for HeatAwareLeaderModel
impl Sync for HeatAwareLeaderModel
impl Unpin for HeatAwareLeaderModel
impl UnsafeUnpin for HeatAwareLeaderModel
impl UnwindSafe for HeatAwareLeaderModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more