asopi tech
asopi techIndie Developer

Asopitech VS

pgvector vs Alopex DB

The pgvector extension's vector types, HNSW and IVFFlat, and distance metrics. Also explains how it differs from Alopex DB.

Updated: Oct 11, 2026

What pgvector is

pgvector is an extension that adds a vector type and vector indexes to PostgreSQL. You load it with CREATE EXTENSION vector. Vector search runs inside existing SQL and transactions. The README says PostgreSQL features such as ACID, point-in-time recovery, and JOINs apply as they are.

How it works

  • As an extension, it plugs into PostgreSQL’s type, operator, and index machinery. Isolation levels, the change log, and replication follow PostgreSQL itself.
  • Approximate search indexes are HNSW and IVFFlat. Exact search (no index) also works.
  • The README says HNSW wins on the speed–recall tradeoff but builds slower and uses more memory. HNSW can be created on empty data. IVFFlat needs a training step.
  • pgvectorscale: an extension that builds on pgvector. It adds the StreamingDiskANN index, Statistical Binary Quantization compression, and label-based filtering. It is written in Rust.
  • VectorChord: a disk-efficient vector index extension compatible with pgvector types and syntax. It depends on pgvector.

Main features

  • Types: vector up to 2,000 dimensions, halfvec up to 4,000 dimensions. sparsevec and bit types also exist.
  • Indexes: HNSW and IVFFlat.
  • Distances: L2, inner product, cosine, L1, and bit Hamming and Jaccard.

Limits

It inherits PostgreSQL’s limits. Normally a single primary accepts writes, and there is no multi-node write distribution. For very large vector sets, the README describes options such as quantization. pgvectorscale supports cosine, L2, and inner product distance, and label values must be within the smallint range. Building pgvectorscale on Intel Macs is not supported because of an open issue. VectorChord is licensed under a choice of AGPLv3 or Elastic License v2.

How it differs from Alopex DB

Both let you run vector search inside SQL, and both offer HNSW.

pgvector is an extension you add to PostgreSQL. In Alopex DB, the vector type and HNSW index are part of the core, so they work as soon as you install it. SQL, KV, and vectors live together in one single-file database.

Choose cosine, L2, or inner product as the distance. Use exact search over every row for precise results, or an HNSW index for fast search. Both combine with SQL conditions.

AspectpgvectorAlopex DB
Delivered asPostgreSQL extensionCore feature
IndexesHNSW, IVFFlatHNSW, exact search
DistancesL2, inner product, cosine, L1, etc.Cosine, L2, inner product

Alopex DB has vector search in the core and finds nearest neighbors from SQL without an extension. Try the same queries in the quickstart.

References