pub struct TableRefWithStats {
pub name: String,
pub n_pages: u64,
pub n_rows: u64,
pub has_stats: bool,
}Expand description
A table reference paired with cost-model inputs for join ordering.
Used by order_join_inputs_with_hints to decide the evaluation order of a
multi-table FROM clause. The has_stats flag lets the caller distinguish
ANALYZE-populated inputs from pure heuristic fallbacks: when every
reference is marked has_stats == false, callers should preserve the
source order (there is nothing to optimize on).
The struct is intentionally minimal so it can be constructed directly by
crates/fsqlite-core/src/connection.rs without pulling in the full
bound-statement type surface. Wire-up from connection.rs is staged
separately (see PLANNER-3 follow-up); for now this lives in the planner
and is exercised via unit tests.
Fields§
§name: StringTable name (used only for diagnostics / test assertions).
n_pages: u64Estimated B-tree pages — passed to estimate_cost_ext.
n_rows: u64Estimated row count — passed to estimate_cost_ext. 0 means
“no row-count hint available”; see Self::has_stats.
has_stats: boolWhether this input was populated from sqlite_stat1 / ANALYZE.
When false, ordering callers should fall back to source order.
Implementations§
Source§impl TableRefWithStats
impl TableRefWithStats
Sourcepub fn from_table_stats(stats: &TableStats) -> Self
pub fn from_table_stats(stats: &TableStats) -> Self
Construct a TableRefWithStats from a TableStats snapshot.
has_stats is derived from the stats source: only
StatsSource::Analyze (populated from sqlite_stat1) counts as
authoritative for join ordering.
Trait Implementations§
Source§impl Clone for TableRefWithStats
impl Clone for TableRefWithStats
Source§fn clone(&self) -> TableRefWithStats
fn clone(&self) -> TableRefWithStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableRefWithStats
impl Debug for TableRefWithStats
impl Eq for TableRefWithStats
Source§impl PartialEq for TableRefWithStats
impl PartialEq for TableRefWithStats
Source§fn eq(&self, other: &TableRefWithStats) -> bool
fn eq(&self, other: &TableRefWithStats) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TableRefWithStats
Auto Trait Implementations§
impl Freeze for TableRefWithStats
impl RefUnwindSafe for TableRefWithStats
impl Send for TableRefWithStats
impl Sync for TableRefWithStats
impl Unpin for TableRefWithStats
impl UnsafeUnpin for TableRefWithStats
impl UnwindSafe for TableRefWithStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.