pub fn create_hnsw_index_sql(
table: &str,
ops_class: &str,
m: Option<usize>,
ef_construction: Option<usize>,
) -> StringExpand description
Returns the CREATE INDEX statement for an HNSW index.
The operator class is chosen based on the distance metric:
- Cosine โ
vector_cosine_ops - L2 โ
vector_l2_ops - InnerProduct โ
vector_ip_ops
ยงParameters
table: table nameops_class: one ofvector_cosine_ops,vector_l2_ops,vector_ip_opsm: HNSWmparameter (max connections per layer).Noneuses the PG default (16).ef_construction: HNSW build-time search width.Noneuses the PG default (64).