pub enum QueryCardinality {
Single,
Multiple,
List,
}Expand description
Query cardinality classification.
Indicates how many entities a query typically returns, which affects expected cache hit rate.
Variants§
Single
Single entity: WHERE id = ? → 1 entity Expected cache hit rate: 91%
Multiple
Multiple entities: WHERE id IN (?, …) → N entities Expected cache hit rate: 88%
List
All entities: WHERE 1=1 or no WHERE → all entities Expected cache hit rate: 60%
Implementations§
Source§impl QueryCardinality
impl QueryCardinality
Sourcepub fn expected_hit_rate(&self) -> f64
pub fn expected_hit_rate(&self) -> f64
Get expected cache hit rate for this cardinality (0-1).
Trait Implementations§
Source§impl Clone for QueryCardinality
impl Clone for QueryCardinality
Source§fn clone(&self) -> QueryCardinality
fn clone(&self) -> QueryCardinality
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 QueryCardinality
impl Debug for QueryCardinality
Source§impl Ord for QueryCardinality
impl Ord for QueryCardinality
Source§fn cmp(&self, other: &QueryCardinality) -> Ordering
fn cmp(&self, other: &QueryCardinality) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for QueryCardinality
impl PartialEq for QueryCardinality
Source§impl PartialOrd for QueryCardinality
impl PartialOrd for QueryCardinality
impl Copy for QueryCardinality
impl Eq for QueryCardinality
impl StructuralPartialEq for QueryCardinality
Auto Trait Implementations§
impl Freeze for QueryCardinality
impl RefUnwindSafe for QueryCardinality
impl Send for QueryCardinality
impl Sync for QueryCardinality
impl Unpin for QueryCardinality
impl UnsafeUnpin for QueryCardinality
impl UnwindSafe for QueryCardinality
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.