Skip to main content

grafeo_core/statistics/
mod.rs

1//! Statistics for cost-based query optimization.
2//!
3//! The query optimizer uses these statistics to pick the best execution plan.
4//! Without stats, it has to guess - with stats, it knows that filtering by
5//! "status = 'active'" returns 90% of rows while "label = 'Admin'" returns 0.1%.
6//!
7//! | Statistic | What it tells the optimizer |
8//! | --------- | --------------------------- |
9//! | Label cardinality | How many nodes have this label |
10//! | Property histograms | Distribution of values for range predicates |
11//! | Degree stats | How many edges per node (affects traversal cost) |
12//! | Distinct counts | Selectivity of equality predicates |
13
14mod collector;
15mod histogram;
16mod rdf;
17
18pub use collector::{
19    ColumnStatistics, EdgeTypeStatistics, LabelStatistics, PropertyKey, Statistics, TableStatistics,
20};
21pub use histogram::{Histogram, HistogramBucket};
22pub use rdf::{
23    IndexStatistics, PredicateStatistics, RdfStatistics, RdfStatisticsCollector, TriplePosition,
24};