pub struct AnnHealth {
pub vectors: u64,
pub clusters_nonempty: u32,
pub clusters_total: u32,
pub runs: u32,
pub largest_cluster: u32,
pub largest_cluster_vectors: u64,
pub imbalance: f64,
pub payload_bytes: u64,
}Expand description
Cheap structural health of one ANN payload, computed from the in-memory run directory in O(runs) — payload bytes are never touched.
Two production failure modes motivated every field here (see
docs/diagnostics.md): a 31%-of-vectors leaf built from degenerate
embeddings, and probe read-amplification from byte-copy merges that leave
one logical cluster scattered across many physical extents.
Fields§
§vectors: u64Vectors across all runs.
clusters_nonempty: u32Distinct cluster IDs holding at least one posting.
clusters_total: u32Codebook size (num_clusters from the header).
runs: u32Run-directory entries; each is one physical extent on disk.
largest_cluster: u32Vectors in the most populated cluster, with its ID.
largest_cluster_vectors: u64§imbalance: f64Faiss imbalance_factor over non-empty clusters:
K · Σ nᵢ² / N². 1.0 is perfectly balanced; a value of γ means a
fixed-nprobe probe computes γ× the distances of the balanced
baseline in expectation.
payload_bytes: u64Bytes of the codes columns (what a probe of every leaf would read).
Implementations§
Trait Implementations§
impl Copy for AnnHealth
impl StructuralPartialEq for AnnHealth
Auto Trait Implementations§
impl Freeze for AnnHealth
impl RefUnwindSafe for AnnHealth
impl Send for AnnHealth
impl Sync for AnnHealth
impl Unpin for AnnHealth
impl UnsafeUnpin for AnnHealth
impl UnwindSafe for AnnHealth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more