pub struct RdfStatistics {
pub total_triples: u64,
pub subject_count: u64,
pub predicate_count: u64,
pub object_count: u64,
pub predicates: HashMap<String, PredicateStatistics>,
pub subject_histogram: Option<Histogram>,
pub object_histogram: Option<Histogram>,
pub index_stats: IndexStatistics,
}Expand description
Statistics for an RDF triple store.
Fields§
§total_triples: u64Total number of triples.
subject_count: u64Number of unique subjects.
predicate_count: u64Number of unique predicates.
object_count: u64Number of unique objects.
predicates: HashMap<String, PredicateStatistics>Per-predicate statistics.
subject_histogram: Option<Histogram>Subject frequency histogram (for join selectivity).
object_histogram: Option<Histogram>Object frequency histogram.
index_stats: IndexStatisticsIndex access pattern statistics (for cost model).
Implementations§
Source§impl RdfStatistics
impl RdfStatistics
Sourcepub fn update_from_counts(
&mut self,
total_triples: u64,
subject_count: u64,
predicate_count: u64,
object_count: u64,
)
pub fn update_from_counts( &mut self, total_triples: u64, subject_count: u64, predicate_count: u64, object_count: u64, )
Updates statistics from an RDF store.
Sourcepub fn update_predicate(&mut self, predicate: &str, stats: PredicateStatistics)
pub fn update_predicate(&mut self, predicate: &str, stats: PredicateStatistics)
Adds or updates predicate statistics.
Sourcepub fn get_predicate(&self, predicate: &str) -> Option<&PredicateStatistics>
pub fn get_predicate(&self, predicate: &str) -> Option<&PredicateStatistics>
Gets predicate statistics.
Sourcepub fn estimate_triple_pattern_cardinality(
&self,
subject_bound: bool,
predicate_bound: Option<&str>,
object_bound: bool,
) -> f64
pub fn estimate_triple_pattern_cardinality( &self, subject_bound: bool, predicate_bound: Option<&str>, object_bound: bool, ) -> f64
Estimates cardinality for a triple pattern.
§Arguments
subject_bound- Whether the subject is a constantpredicate_bound- Whether the predicate is a constant (and its value if so)object_bound- Whether the object is a constant
Sourcepub fn estimate_join_selectivity(
&self,
var_position1: TriplePosition,
var_position2: TriplePosition,
) -> f64
pub fn estimate_join_selectivity( &self, var_position1: TriplePosition, var_position2: TriplePosition, ) -> f64
Estimates join selectivity between two patterns sharing a variable.
Sourcepub fn estimate_filter_selectivity(&self, predicate_iri: Option<&str>) -> f64
pub fn estimate_filter_selectivity(&self, predicate_iri: Option<&str>) -> f64
Estimates the cardinality after a FILTER operation.
Trait Implementations§
Source§impl Clone for RdfStatistics
impl Clone for RdfStatistics
Source§fn clone(&self) -> RdfStatistics
fn clone(&self) -> RdfStatistics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RdfStatistics
impl Debug for RdfStatistics
Source§impl Default for RdfStatistics
impl Default for RdfStatistics
Source§fn default() -> RdfStatistics
fn default() -> RdfStatistics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RdfStatistics
impl RefUnwindSafe for RdfStatistics
impl Send for RdfStatistics
impl Sync for RdfStatistics
impl Unpin for RdfStatistics
impl UnwindSafe for RdfStatistics
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