RFC Registry/RFC-005
RFC-005backendUnder Review
pgvector Ecosystem Standard

PostgreSQL pgvector HNSW In-Memory Index Construction Standard

Mandates Hierarchical Navigable Small World (HNSW) indexing over IVFFlat for production vector databases to guarantee >98% recall without pre-populated training data.

Authors:Andrew Kane, AgentRules Data Architecture SIG
Version:v0.9.1
Last Ratified:2026-03-25

RFC-2119 Invariant Mandates

The keywords “MUST”, “MUST NOT”, and “SHOULD” in this document are to be interpreted as described in BCP 14 / RFC 2119.

MUST NOTClause 1

Production vector tables MUST NOT create IVFFlat indexes on unpopulated or rapidly mutating datasets.

Engineering Rationale:IVFFlat requires pre-populated clustering centroids. If built on an empty or small table, it degrades to 100% sequential scans.
Failure Blast Radius:O(N) sequential table scans causing query timeouts as datasets grow.
MUSTClause 2

Vector indexes SHOULD specify USING hnsw with tuned parameters (m = 16..24, ef_construction = 64..128) and the correct distance operator (<=> for cosine, <-> for L2).

Engineering Rationale:HNSW builds graph-based indices incrementally during inserts and maintains high recall without retraining.
Failure Blast Radius:Ensures sub-15ms vector query latency at 1,000,000+ embeddings.

Complete RFC Specification Document

IETF Formal Markdown Format
# RFC-005: pgvector HNSW Indexing Standard

```sql
CREATE INDEX idx_documents_embedding_hnsw 
ON documents 
USING hnsw (embedding vector_cosine_ops) 
WITH (m = 16, ef_construction = 64);
```

Community Consensus Rating

Do these behavioral constraints represent the highest engineering standard for your team?

97% Consensus