hnsw
hnsw · Experimental in-memory HNSW indexing for real arrays
Overview
Usage
Sources:
hnsw is an older PostgreSQL ANN prototype using real arrays and an in-memory index built on demand. It is separate from pgvector’s similarly named index access method.
Core Workflow
Operational Boundaries
Create the extension as a superuser. Its SQL defines l2_distance(real[], real[]), the <-> operator, the hnsw access method and its real-array operator class. Set maxelements to bound the index and dims to match the vector dimension; ef controls considered neighbors. Query using distance ordering with a limit.
The upstream source last changed in 2023 and declares no current PostgreSQL-major matrix. It has no preload declaration and is relocatable. Its in-memory design needs explicit capacity planning and restart/recovery validation; do not assume pgvector’s durability or operational contract. Avoid installing another extension with a conflicting access-method name in the same database.