VectorChord

VectorChord is a high-performance alternative to pgvector. optimized for faster searches and better scalability. It is an open-source PostgreSQL extension specifically designed to handle massive-scale vector searches with significantly higher speed and better memory efficiency.

While pgvector is the industry standard for general use, VectorChord was built to push the limits of how many vectors a single database can handle without slowing down.

Key features

  • New indexing algorithm: While pgvector primarily uses Hierarchical Navigable Small Worlds (HNSW), VectorChord introduces a proprietary index called VChord. It uses a technique called Product Quantization combined with optimized graph searches to reduce the memory footprint.

  • Superior scalability: It is designed to handle billion-scale datasets. It can often perform searches 10x faster than standard HNSW indexes while using up to 70% less RAM.

  • Hardware optimization: It is built to take full advantage of modern CPU instructions (like SIMD), making the actual math of "comparing vectors" much faster at the hardware level.

When to choose VectorChord

  • Your pgvector HNSW/ IVF (Inverted File) indexes struggle with high dimensions or large data volumes.

  • You need lower query latency for top-k searches at high throughput.

  • You want to stay on the vector type while changing only the index implementation.

If you are building a basic chatbot or a small recommendation engine, pgvector is usually enough. However, if you are building a search engine over millions (or billions) of documents and find that your database server is running out of RAM or getting sluggish, VectorChord is the specialized tool designed to solve those scaling "growing pains".

Core use cases

  • Enterprise-scale RAG: Ideal for Retrieval-Augmented Generation involving billions of vectors, where high-volume top-k lookups must meet strict, high-speed latency requirements.

  • High-Dimensional data handling: Optimized for complex multimodal or LLM-generated embeddings that exceed the dimensional limits of standard Approximate Nearest Neighbor (ANN) configurations.

  • Performance-critical APIs: Powers recommendation engines, personalization, and semantic search platforms where maintaining ultra-low P95/P99 latency is mission-critical.

Example

Create a table with a vector column and load embeddings. Build a VectorChord index and run ANN queries.

-- Create a table with vector column
CREATE TABLE items (
  id bigint primary key,
  embedding vector(1024)
);

-- Create a VectorChord index (IVF‑RaBitQ)
CREATE INDEX items_embedding_vchordq
  ON items
  USING vchordq (embedding);

-- Example query (distance operator depends on your metric)
-- For illustration, using a placeholder parameter :query_vec
SELECT id
FROM items
ORDER BY embedding <-> :query_vec
LIMIT 10;

Could this page be better? Report a problem or suggest an addition!