Skip to main content

GraphStats

Struct GraphStats 

Source
pub struct GraphStats<'a> { /* private fields */ }
Expand description

Construction goes through GraphStats::new (the ADR-0218 one- construction idiom the sibling plan-time stats impls use), so an inline build cannot drift from it.

Implementations§

Source§

impl<'a> GraphStats<'a>

Source

pub fn new( graph: &'a Graph, params: &'a BTreeMap<String, Value>, ) -> GraphStats<'a>

The one construction: the connection’s graph and the statement’s parameters.

Trait Implementations§

Source§

impl PatternStats for GraphStats<'_>

Source§

fn range_rows( &self, label: &NamedToken, property: &NamedToken, op: BinaryOp, bound: &Expr, ) -> Option<u64>

ADR-0486: the range window’s posting-length count, delegated to Graph::pattern_range_rows — the same range_seek_cardinality the executor’s own seek cardinality reads, so the ladder’s price and the runtime funnel decline together. The bound resolves the equality_rows way: literals and parameters only, None for anything else (a temporal literal’s function call included — the funnel’s eval-resolved bound is the runtime’s, not the plan-time estimate’s).

Source§

fn contains_rows( &self, label: &NamedToken, property: &NamedToken, needle: &Expr, ) -> Option<ContainsCount>

LABS-643: the count is always measurable — the TEXT index’s exact answer, or without one the sampled estimate (Graph::pattern_contains_rows) — so only a non-string needle stays unmeasured (None, the ladder’s fallback). The provenance stays typed in ContainsCount; the planner compounds the sampled form’s scan floor on its one scale (ADR-0474). The sample rides the name-keyed store path like range_rows; an Absent label is the measurable zero the by-name path answers for a label never interned.

Source§

fn key_stats( &self, label: &NamedToken, property: &NamedToken, ) -> Option<Arc<KeyStats>>

The per-key statistics of the (label, property) pair, shared with the graph’s published entry; None while the label’s statistics are unbuilt (a consult records the build request, the pump serves it).

Source§

fn equality_estimate( &self, label: &NamedToken, property: &NamedToken, value: &Expr, ) -> Option<RowEstimate>

An equality’s row estimate with provenance, resolved the equality_rows way (literals and parameters only). The sources are ordered here and nowhere else: a declared index’s postings first, then the key’s sketches.

Source§

fn degree_tail(&self, label: &NamedToken, rel_type: &NamedToken) -> Option<u64>

LABS-351: the live graph’s histogram tail (the executor keeps the real one; the null stats default None).

Source§

fn any_degree_tail(&self, rel_type: Option<&SmallName>) -> Option<u64>

LABS-991: the live histograms’ any-label tail.

Source§

fn degree_moments( &self, labels: &[NamedToken], rel_types: &[NamedToken], ) -> Option<DegreeMoments>

The live histograms’ out-degree moments, bounded per label by GraphStats::min_over_labels.

Source§

fn in_degree_sum( &self, labels: &[NamedToken], rel_types: &[NamedToken], ) -> Option<u128>

The live pair counts’ in-degree sum, bounded the same way as [PatternStats::degree_moments]: the smallest per-label sum.

Source§

fn label_rows(&self, (name, token): &NamedToken) -> Option<u64>

Nodes carrying label.
Source§

fn equality_rows( &self, (label, label_token): &NamedToken, property: &NamedToken, value: &Expr, ) -> Option<u64>

Hits of an equality seek on a RANGE index for (label, property). value is the raw predicate expression. Implementors resolve literals and parameters with Expr::seek_value and return None for anything else. None also means no RANGE index, not zero hits.
Source§

fn rel_type_rows(&self, (name, token): &NamedToken) -> Option<u64>

Relationships of rel_type.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GraphStats<'a>

§

impl<'a> !UnwindSafe for GraphStats<'a>

§

impl<'a> Forget for GraphStats<'a>

§

impl<'a> Freeze for GraphStats<'a>
where &'a Graph: Freeze, &'a BTreeMap<String, Value>: Freeze,

§

impl<'a> Move for GraphStats<'a>

§

impl<'a> Send for GraphStats<'a>
where &'a Graph: Send, &'a BTreeMap<String, Value>: Send,

§

impl<'a> Sync for GraphStats<'a>
where Arc<StoreServices>: Sync, OnceLock<Arc<dyn PropStore>>: Sync, Mutex<HashSet<i64>>: Sync, Atomic<i64>: Sync, Atomic<u64>: Sync, Atomic<bool>: Sync, RwLock<Store<Chain<LiveNode>>>: Sync, RwLock<Store<Chain<LiveRel>>>: Sync, RwLock<Store<TypedAdj>>: Sync, RwLock<ArenaStore>: Sync, Mutex<CountStats>: Sync, Mutex<DegreeHistograms>: Sync, Mutex<ConstraintKeyIndex>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<(Arc<str>, SharedValue<u32>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<(u32, SharedValue<Arc<str>>)>>>]>: Sync, Atomic<u32>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<(Vec<u32>, SharedValue<Arc<Vec<String>>>)>>>]>: Sync, Mutex<Catalog>: Sync, Mutex<TheaterData>: Sync, Mutex<HashMap<String, ConstraintDef>>: Sync, Mutex<QueryStats>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<(u32, SharedValue<HashSet<i64>>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<PropPairIndex>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<GramIndex>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<RangeIndex>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<PointIndex>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<Arc<KeyStats>>)>>>]>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<(u32, SharedValue<LabelState>)>>>]>: Sync, Atomic<usize>: Sync, Mutex<Ledger>: Sync, Mutex<Arc<IndexCharge>>: Sync, BoxRaw<[CachePadded<RwLock<RawRwLock, RawTable<((u32, u32), SharedValue<Arc<VectorMatrixSlot>>)>>>]>: Sync, Mutex<ContainsMemo>: Sync, Mutex<Vec<RedoOp>>: Sync, RwLock<Inner>: Sync, Mutex<AppliedTokenChanges>: Sync, BoxRaw<[Atomic<u64>]>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl<'a> Unpin for GraphStats<'a>
where &'a Graph: Unpin, &'a BTreeMap<String, Value>: Unpin,

§

impl<'a> UnsafeUnpin for GraphStats<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V