MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / eq_selectivity

Method eq_selectivity

nodedb/src/engine/sparse/stats.rs:135–141  ·  view source on GitHub ↗

Selectivity estimate for equality predicate (1 / distinct_count).

(&self)

Source from the content-addressed store, hash-verified

133
134 /// Selectivity estimate for equality predicate (1 / distinct_count).
135 pub fn eq_selectivity(&self) -> f64 {
136 if self.distinct_count == 0 {
137 1.0
138 } else {
139 1.0 / self.distinct_count as f64
140 }
141 }
142
143 /// Selectivity estimate for range predicate (heuristic: 0.33).
144 pub fn range_selectivity(&self) -> f64 {

Callers 1

eq_selectivityFunction · 0.80

Calls

no outgoing calls

Tested by 1

eq_selectivityFunction · 0.64