pub struct MemoizeCache {
pub group_maps: BTreeMap<String, Option<Rc<GroupMap>>>,
pub exists_sets: BTreeMap<String, Option<Rc<ExistsSet>>>,
pub exists_plans: BTreeMap<usize, Vec<Option<Rc<ExistsSet>>>>,
pub expr_plans: BTreeMap<usize, ExprPlan>,
pub in_sets: BTreeMap<usize, Option<InListSetEntry>>,
pub has_subquery: BTreeMap<usize, bool>,
pub hit_count: u64,
pub miss_count: u64,
/* private fields */
}Fields§
§group_maps: BTreeMap<String, Option<Rc<GroupMap>>>v7.29 (round-22 phase 3) - batch-evaluated correlated scalar subqueries: subquery repr -> Some((outer column, key -> value map built in ONE pass)) or None when the shape can’t batch (so we don’t re-analyse it per row). Turns 23.5k per-group executions into one grouped scan + 23.5k lookups.
exists_sets: BTreeMap<String, Option<Rc<ExistsSet>>>v7.34 (mailrs conn-pool P0) - decorrelated [NOT] EXISTS: subquery
repr -> Some(semi/anti-join key-set) or None when the shape can’t
decorrelate (don’t re-analyse per row). Parallel to group_maps.
exists_plans: BTreeMap<usize, Vec<Option<Rc<ExistsSet>>>>v7.34.2 (EXISTS-FILTER baseline finding) — host-expression-ptr
indexed plan: walk the WHERE expr ONCE, collect every EXISTS
subquery in pre-order, build a decorrelated set for each, and
store them as a Vec indexed by pre-order position. Per-row
dispatch then walks the (cloned) expression in the same
pre-order, increments an ordinal cursor, and reads the matching
set out of this plan instead of re-running
alloc::format!("{subquery}") and a fresh BTreeMap probe per
row — the dominant cost of the 7.34.0 EXISTS-FILTER baseline.
None slot = couldn’t decorrelate that particular EXISTS; the
dispatcher falls back to the legacy per-row resolver for it.
expr_plans: BTreeMap<usize, ExprPlan>v7.29 (3c) - host-expression ptr -> (subquery count, plan).
in_sets: BTreeMap<usize, Option<InListSetEntry>>v7.30.2 (mailrs round-25) - InList node ptr -> membership set
for large all-literal IN lists, built once per row loop.
Turns the O(rows × list) membership scan into
O(rows × log list). None = analysed, not eligible.
has_subquery: BTreeMap<usize, bool>v7.30.2 (mailrs round-25) - host-expression ptr -> “contains a subquery node”. The walk is O(tree) and a materialised IN list makes the tree huge — caching it makes the per-row dispatch O(log n) instead of O(24k list elements).
hit_count: u64§miss_count: u64Implementations§
Source§impl MemoizeCache
impl MemoizeCache
pub fn new() -> Self
pub const fn with_max_entries(self, n: usize) -> Self
pub const fn with_max_bytes(self, b: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for MemoizeCache
impl Clone for MemoizeCache
Source§fn clone(&self) -> MemoizeCache
fn clone(&self) -> MemoizeCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more