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

Function eq_selectivity

nodedb/src/engine/sparse/stats.rs:374–381  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373 #[test]
374 fn eq_selectivity() {
375 let mut stats = ColumnStats::new();
376 for i in 0..100 {
377 stats.observe(Some(&serde_json::Value::String(format!("v{i}"))));
378 }
379 let sel = stats.eq_selectivity();
380 assert!(sel > 0.005 && sel < 0.02, "selectivity: {sel}");
381 }
382
383 #[test]
384 fn stats_store_roundtrip() {

Callers

nothing calls this directly

Calls 2

eq_selectivityMethod · 0.80
observeMethod · 0.45

Tested by

no test coverage detected