█

AI/TLDR

pg_vectorsearch

A partition-based PRISM index for fast vector search inside PostgreSQL

Vector DatabasesOpen source
Updated
13 Oct 2026
Language
C
License
PostgreSQL
Coverage
1 story
$git clone https://github.com/timescale/pg_vectorsearch.git

What's new

13 Oct 2026

Tiger Data announced pg_vectorsearch in alpha, with the PRISM index and benchmarks showing 100M-vector builds in under two hours where pgvector's HNSW took 42 hours. pgvectorscale moves to maintenance mode.

Latest news

Overview

pg_vectorsearch is an open-source PostgreSQL extension from Tiger Data (the company behind Timescale) for approximate nearest neighbor (ANN) vector search. It adds an index type called PRISM (Partitioned Routing Index for Similarity Matching), an IVF-style index with hierarchical routing that is designed for collections of 100 million vectors and more.

Bar chart of index build time: at 100M vectors PRISM builds in 1 h 40 min on 128 GiB and 49 min on 512 GiB while HNSW does not finish or takes 42 h; at 1M vectors PRISM takes about 3 min while HNSW does not finish or takes about 21.7 h.
Index build time from Tiger Data's launch benchmark: PRISM against pgvector's HNSW (halfvec) on the same machines.Tiger Data, Announcing pg_vectorsearch ↗

Instead of the graph that HNSW builds, PRISM groups similar vectors into k-means partitions and stores compressed RaBitQ codes, about one bit per dimension, packed into database pages. A query walks a small tree of cluster centroids and then scans the nearest partitions with SIMD (AVX2, AVX512 or NEON). Vectors near a partition boundary can be stored in more than one partition to raise recall, and a two-stage search with error bounds limits how much full-precision reranking is needed.

The extension works with its own `vec32` and `vec16` types and can also index existing pgvector `vector` and `halfvec` columns directly, so a table that uses pgvector keeps its schema and queries. Tiger Data positions it as the successor to pgvectorscale, which it says is moving to maintenance mode. The project is marked alpha: the README says it is meant for testing, not production, and that indexes should be recreated between prereleases.

What it does

  • PRISM index: k-means partitions with hierarchical centroid routing, aimed at 100M+ vectors
  • RaBitQ quantization with a two-stage, error-bounded search that reduces full-precision reranking
  • SIMD distance computation on AVX2, AVX512 and NEON
Bar chart of P50 query latency on 100M Cohere embeddings: at 95% recall PRISM takes 6 ms on 128 GiB and 4 ms on 512 GiB versus 8 ms for HNSW on 512 GiB; at 99% recall PRISM takes 21 ms and 19 ms while HNSW is not achieved.
Query latency at 100 million vectors: PRISM on a 128 GiB machine against HNSW on four times the hardware.Tiger Data, Announcing pg_vectorsearch ↗
  • Indexes existing pgvector vector and halfvec columns without rewriting the table
  • L2, inner-product and cosine operator classes for vec32/vector and vec16/halfvec
  • One main tuning knob, prism.nprobe, where 0 targets about 95% recall automatically
  • Inserts, updates and deletes, with oversized posting lists split by prism_rebalance or REINDEX

Getting started

pg_vectorsearch builds from source with Meson and needs PostgreSQL 18 or later with development headers and a C11 compiler (GCC 11+ or Clang 14+). Load your data before creating the index, because the index is sized from the row count.

Build and install the extension

Clone the repository and build it in release mode. CBLAS is optional and speeds up RaBitQ encoding.

bashbash
git clone https://github.com/timescale/pg_vectorsearch.git
cd pg_vectorsearch
meson setup builddir --buildtype=release
meson install -C builddir

Create a table and load vectors

Enable the extension and store embeddings in a vec32 column (use vec16 to halve storage).

sqlsql
CREATE EXTENSION pg_vectorsearch;

CREATE TABLE items (
    id serial PRIMARY KEY,
    embedding vec32(3) STORAGE PLAIN
);

INSERT INTO items (embedding)
SELECT ARRAY[i::real, (i % 7)::real, (i % 5)::real]::vec32
FROM generate_series(1, 1000) i;

Build a PRISM index and query it

Create the index with an operator class, optionally raise nprobe for more recall, then order by distance.

sqlsql
CREATE INDEX ON items USING prism (embedding vec32_l2_ops);

SET prism.nprobe = 40;  -- 0 = auto (about 0.95 recall)

SELECT * FROM items
ORDER BY embedding <-> '[3,1,2]'
LIMIT 5;

Or index an existing pgvector table

PRISM reads pgvector vector and halfvec columns directly. Map vector_<metric>_ops to vec32_<metric>_ops (halfvec to vec16), check with EXPLAIN that the planner uses it, then drop the old HNSW index if you no longer need it.

sqlsql
CREATE EXTENSION vector;
CREATE EXTENSION pg_vectorsearch;

CREATE INDEX documents_embedding_prism
    ON documents USING prism (embedding vec32_l2_ops);

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Running vector search on 100M+ embeddings inside PostgreSQL without a separate vector database
  • Replacing a pgvector HNSW index that is too slow to build or too large for available memory
  • Serving RAG retrieval with high recall on smaller, cheaper database instances
  • Testing a partition-based ANN index alongside an existing pgvector setup before migrating

How pg_vectorsearch compares

pg_vectorsearch alongside other open-source vector databases tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Supabase★ 112kManaged Postgres backend whose Vector toolkit (pgvector) stores, indexes, and queries embeddings next to transactional data.
Redis Cloud★ 76.8kFully-managed Redis with built-in vector search, offering low-latency similarity and hybrid queries over any embeddings.
Milvus★ 46.4kA distributed vector database for storing and searching billions of embeddings at scale, with multiple index types and Kubernetes-native deployment.
FAISS★ 41.2kA library from Meta for efficient similarity search and clustering of dense vectors, with both exact and approximate indexes.
Qdrant★ 35.1kA Rust-based vector search engine that stores embeddings with rich payload filtering for semantic search and recommendation systems.
Chroma★ 29.5kA developer-focused vector database designed for quickly building retrieval and RAG features with a simple Python and JavaScript API.
pgvector★ 23.4kA PostgreSQL extension that adds a vector data type and similarity search so you can store and query embeddings inside an existing Postgres database.
pg_vectorsearch★ 269A partition-based PRISM index for fast vector search inside PostgreSQL