pub struct ReadSnapshot {
pub store: NodeStore,
pub catalog: Catalog,
pub csrs: HashMap<u32, CsrForward>,
pub db_root: PathBuf,
pub label_row_counts: HashMap<LabelId, usize>,
/* private fields */
}Expand description
Immutable snapshot of storage state required to execute a read query.
Groups the fields that are needed for read-only access to the graph so they
can eventually be cloned/shared across parallel executor threads without
bundling the mutable per-query state that lives in Engine.
Fields§
§store: NodeStore§catalog: Catalog§csrs: HashMap<u32, CsrForward>Per-relationship-type CSR forward files, keyed by RelTableId (u32).
db_root: PathBuf§label_row_counts: HashMap<LabelId, usize>Cached live node count per label, updated on every node creation.
Used by the planner to estimate cardinality without re-scanning the node store’s high-water-mark file on every query.
Implementations§
Source§impl ReadSnapshot
impl ReadSnapshot
Sourcepub fn rel_degree_stats(&self) -> &HashMap<u32, DegreeStats>
pub fn rel_degree_stats(&self) -> &HashMap<u32, DegreeStats>
Return per-relationship-type out-degree statistics, computing them on first call and caching the result for all subsequent calls.
The CSR forward scan is only triggered once per ReadSnapshot instance,
and only when a caller actually needs degree statistics. Queries that
never access this (e.g. simple traversals Q3/Q4) pay zero overhead.
Auto Trait Implementations§
impl !Freeze for ReadSnapshot
impl RefUnwindSafe for ReadSnapshot
impl Send for ReadSnapshot
impl Sync for ReadSnapshot
impl Unpin for ReadSnapshot
impl UnsafeUnpin for ReadSnapshot
impl UnwindSafe for ReadSnapshot
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more