pub struct DegreeCache { /* private fields */ }Expand description
Pre-computed out-degree for every node slot across all relationship types.
Built eagerly at engine-open time by scanning:
- CSR forward files (checkpointed edges) — contribution per slot from offsets.
- Delta log records (uncheckpointed edges) — each
DeltaRecord.srcincrements the source slot’s count.
Keyed by the lower-32-bit slot extracted from NodeId.0
(i.e. node_id & 0xFFFF_FFFF).
Lookup is O(1). Engine::top_k_by_degree uses this cache to answer
“top-k highest-degree nodes of label L” in O(N log k) where N is the
label’s node count (HWM), rather than O(N × E) full edge scans.
Implementations§
Source§impl DegreeCache
impl DegreeCache
Sourcepub fn out_degree(&self, slot: u64) -> u32
pub fn out_degree(&self, slot: u64) -> u32
Return the total out-degree for slot across all relationship types.
Returns 0 for slots that have no outgoing edges.
Trait Implementations§
Source§impl Debug for DegreeCache
impl Debug for DegreeCache
Source§impl Default for DegreeCache
impl Default for DegreeCache
Source§fn default() -> DegreeCache
fn default() -> DegreeCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DegreeCache
impl RefUnwindSafe for DegreeCache
impl Send for DegreeCache
impl Sync for DegreeCache
impl Unpin for DegreeCache
impl UnsafeUnpin for DegreeCache
impl UnwindSafe for DegreeCache
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