pub struct HnswIndexEntry {
pub name: String,
pub column_name: String,
pub metric: DistanceMetric,
pub index: HnswIndex,
pub needs_rebuild: bool,
}Expand description
One HNSW index attached to a table. The distance metric is fixed
at CREATE INDEX time via USING hnsw (col) WITH (metric = '<m>')
(l2 / cosine / dot); omitting the WITH clause defaults to L2,
matching the pre-SQLR-28 behaviour for round-tripping older
sqlrite_master rows that didn’t carry a metric.
Fields§
§name: StringUser-supplied name from CREATE INDEX <name> …. Unique across
both secondary_indexes and hnsw_indexes on a given table.
column_name: StringThe VECTOR column this index covers.
metric: DistanceMetricDistance metric the graph was built for. The optimizer’s HNSW
shortcut only fires when the query’s vec_distance_* function
matches this metric — picking a non-matching distance falls
through to brute-force, since the graph topology is metric-
specific (an L2-pruned graph isn’t a valid cosine search graph
in general, and vice versa).
index: HnswIndexThe graph itself.
needs_rebuild: boolPhase 7d.3 — true iff a DELETE or UPDATE-on-vector-col has invalidated the graph since the last rebuild. INSERT maintains the graph incrementally and leaves this false. The next save rebuilds dirty indexes from current rows before serializing.
Trait Implementations§
Source§impl Clone for HnswIndexEntry
impl Clone for HnswIndexEntry
Source§fn clone(&self) -> HnswIndexEntry
fn clone(&self) -> HnswIndexEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more