PRISM vs HNSW: Two Ways to Index Vectors
Graph indexes link neighbors; partition indexes group and compress. The memory bill differs.
Reviewed by Abhijith N M · 24 October 2026 · Editorial standards
pgvector's HNSW index builds a graph. Every vector becomes a node, and each node keeps pointers to its nearest neighbors. To search, you start somewhere and walk the graph toward the query vector. Building that graph means comparing vectors against each other repeatedly, and the graph itself has to live in memory. Tiger Data's new pg_vectorsearch extension, currently in alpha, ships a different index called PRISM. According to the authors, it uses data partitioning and compression instead of a graph, which reduces memory requirements and index build times. In Tiger Data's own benchmark on 100 million vectors, PRISM built its index in 1 hour 40 minutes on a 128 GB machine. HNSW took 42 hours on a 512 GB machine. Those are vendor-run numbers on unspecified hardware beyond the memory figure, so treat them as a direction, not a guarantee for your data. Why the gap? The source says partitioning and compression reduce memory and build time, but it does not describe PRISM's internals. A plausible explanation—not product documentation—is that a graph index has to establish and maintain neighbor links, which is a lot of pairwise work and a lot of stored pointers, while a partition index does a grouping pass and then compresses. Treat that as analysis. The tradeoff is recall—the fraction of true nearest neighbors the index actually returns. Approximate search always trades accuracy for speed, and the two designs trade differently. The source publishes no recall figures for PRISM, so measure recall on your own vectors before relying on it. pg_vectorsearch works on existing pgvector columns, so you can try it without moving data. Alpha means the index format and the exact DDL may change; check the extension's docs for the current extension name and index syntax.
PRISM vs HNSW: Two Ways to Index Vectors — Visual Breakdown
HNSW (pgvector)
- ✓Stores a neighbor graph: nodes plus pointers
- ✓Search walks the graph toward the query
- ✓Benchmark: 42 hours to build on 100M vectors
- ✓Benchmark machine: 512 GB memory
PRISM (pg_vectorsearch)
- ✓Uses data partitioning and compression, per the authors
- ✓Not graph-based, unlike HNSW
- ✓Benchmark: 1h40m to build on 100M vectors
- ✓Benchmark machine: 128 GB memory
-- pg_vectorsearch is alpha. The evidence does not confirm the extension
-- install name or the PRISM access method name, so check the extension's
-- docs before running DDL. The sketch below shows the shape of the setup.
CREATE EXTENSION IF NOT EXISTS vector; -- pgvector: provides the vector type
-- CREATE EXTENSION IF NOT EXISTS <vectorsearch_extension_name>; -- see docs
-- Existing pgvector columns work as-is.
CREATE TABLE docs (
id bigserial PRIMARY KEY,
body text,
embedding vector(768)
);
-- Create a PRISM index on the vector column.
-- The access method name is not confirmed in the source; see the docs.
-- CREATE INDEX docs_prism_idx ON docs USING <prism_access_method> (embedding);
-- Queries still use the distance operator you already know.
SELECT id, body
FROM docs
ORDER BY embedding <=> $1
LIMIT 10;Quick Concept Check
Test your understanding in 15 seconds
According to the reported benchmark, why did PRISM build its index faster than HNSW?
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.