Skip to main content

Module query_stats

Module query_stats 

Source
Expand description

Persistent runtime statistics for online cost-model adaptation.

Each query through the optimizer reports a QueryObservation capturing the family it dispatched to, the wall-clock latency, and the observed recall (if measurable). QueryStats aggregates these observations into per-family running averages and produces recommended_weights that the cost model uses to correct systematic over/underestimates.

Persistence uses serde_json so the file is grep-able for operators; atomic writes go through a temporary .tmp sibling and a rename.

Structsยง

FamilyStats
Per-family aggregate running statistics.
QueryObservation
Single query observation reported back by the dispatcher after execution.
QueryStats
Aggregated statistics across all index families.