pub struct CardinalityCheckpoint {
pub operator_id: String,
pub estimated: f64,
pub actual: u64,
pub recorded: bool,
}Expand description
A checkpoint for tracking cardinality at a specific point in the plan.
Fields§
§operator_id: StringUnique identifier for this checkpoint (typically operator name/id).
estimated: f64Estimated cardinality from the optimizer.
actual: u64Actual row count observed during execution.
recorded: boolWhether this checkpoint has been recorded.
Implementations§
Source§impl CardinalityCheckpoint
impl CardinalityCheckpoint
Sourcepub fn new(operator_id: &str, estimated: f64) -> Self
pub fn new(operator_id: &str, estimated: f64) -> Self
Creates a new checkpoint with an estimate.
Sourcepub fn deviation_ratio(&self) -> f64
pub fn deviation_ratio(&self) -> f64
Returns the deviation ratio (actual / estimated).
A ratio > 1.0 means we underestimated, < 1.0 means overestimated. Returns 1.0 if estimate is 0 to avoid division by zero.
Sourcepub fn absolute_deviation(&self) -> f64
pub fn absolute_deviation(&self) -> f64
Returns the absolute deviation (|actual - estimated|).
Sourcepub fn is_significant_deviation(&self, threshold: f64) -> bool
pub fn is_significant_deviation(&self, threshold: f64) -> bool
Checks if this checkpoint shows significant deviation.
Trait Implementations§
Source§impl Clone for CardinalityCheckpoint
impl Clone for CardinalityCheckpoint
Source§fn clone(&self) -> CardinalityCheckpoint
fn clone(&self) -> CardinalityCheckpoint
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 moreAuto Trait Implementations§
impl Freeze for CardinalityCheckpoint
impl RefUnwindSafe for CardinalityCheckpoint
impl Send for CardinalityCheckpoint
impl Sync for CardinalityCheckpoint
impl Unpin for CardinalityCheckpoint
impl UnwindSafe for CardinalityCheckpoint
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