Stackness
Sign up
pg_vectorsearch vs pgvector: PRISM vs HNSW build times, filters and which index takes the vector slot in Postgres

pg_vectorsearch vs pgvector: PRISM vs HNSW build times, filters and which index takes the vector slot in Postgres

For a production Postgres database as of 17 October 2026, keep pgvector's HNSW index. pg_vectorsearch 0.1.0, released by Tiger Data (formerly Timescale) on 13 October, is labelled alpha, needs Postgres 18 and is offered by none of the eight managed Postgres services I checked. Test it on a Postgres 18 copy if your HNSW graph no longer fits in RAM or a rebuild takes hours. The deciding number: the launch post's 42 hours against 49 minutes came from an HNSW build that ran short of maintenance_work_mem, and Tiger Data's own July runs built the same index in 6.2 hours against 0.96 for pg_vectorsearch.

pg_vectorsearch vs pgvector at a glance

pg_vectorsearch and pgvector both index vectors inside Postgres and both use the PostgreSQL licence. They differ in algorithm, maturity, Postgres versions, dimension limits and where you can run them. pgvector 0.8.7 shipped on 1 October 2026 and runs on Postgres 13 and up; pg_vectorsearch's PRISM index needs 18 and indexes at most 1,968 dimensions.

pg_vectorsearch (PRISM) pgvector HNSW
Version and status 0.1.0, 13 October 2026, alpha: "meant for testing, not production" 0.8.7, 1 October 2026, stable
Algorithm Partitions from k-means, RaBitQ compressed codes, exact rerank from the table Layered proximity graph
Postgres versions 18 and up 13 and up
Max indexed dimensions 1,968 2,000 (vector), 4,000 (halfvec)
Distances L2, inner product, cosine Those three plus L1, Hamming, Jaccard
Filtered queries Filters after top-k; can return fewer rows than LIMIT Iterative scans since 0.8.0 (October 2024)
Expression indexes Refused Supported
Managed services None found AWS RDS and Aurora, Cloud SQL, AlloyDB, Azure, Supabase, Neon, Tiger Cloud
100M build, Tiger Data's runs 0.96 h (768 GiB box), 49 min (512 GiB box) 6.2 h (768 GiB), 42 h (512 GiB, build graph larger than maintenance_work_mem)

Sources: pg_vectorsearch README and changelog, pgvector README, rekall runs and provider extension pages, read 17 October 2026.

What is pg_vectorsearch?

pg_vectorsearch is a Postgres extension from Tiger Data that adds PRISM, a partition index for approximate nearest neighbour search. Its README calls it "conceptually similar to pgvector's IVFFlat": vectors are grouped by k-means centroids, stored as RaBitQ codes of about one bit per dimension, scanned, and then reranked at full precision from the table. It is not a graph index and not DiskANN.

The DiskANN-style index was Tiger Data's earlier pgvectorscale, from 2024. The launch post says its graph could leave parts unreachable on low-dimensional data, causing recall to drop, and that pgvectorscale "will enter maintenance mode". Asked on Hacker News why PRISM is not a pgvector patch, Tiger Data's CTO Michael Freedman said that when Tiger Data offered pgvectorscale's index to pgvector, the author's preference "seemed to be to focus on the existing index types".

The 42-hour HNSW build spilled to disk

The launch post's headline build figure, 42 hours for HNSW against 49 minutes for PRISM on 100 million vectors, comes from an r8i.16xlarge with 512 GiB of RAM. Tiger Data's own instance config for that machine says the HNSW build graph is "~260 GB at 100M", more than the 204 GB maintenance_work_mem, so it "spills to pgvector's on-disk insert pass and slows the build by orders of magnitude".

Tiger Data's benchmark repository has published runs of the same HNSW index (m=24, half-precision, 179 GiB) on an r8i.24xlarge with 768 GiB:

Run Machine HNSW build PRISM build Ratio
2 September 2026 r8i.16xlarge, 512 GiB 41.97 h 49 min about 51x
15 July 2026 r8i.24xlarge, 768 GiB 6.17 h 0.96 h about 6.4x
16 July 2026 r8g.24xlarge (Graviton) 4.81 h 1.58 h about 3x

One more choice favours PRISM: the HNSW runs used m=24 and ef_construction=200, above pgvector's defaults of 16 and 64, which makes builds slower. Separately, the dataset, Cohere Wikipedia embeddings at 768 dimensions, is stated in the repository but not in the post. PRISM still builds several times faster. A 3x to 6x gap is the number to plan with.

PRISM answers 1.7 to 3 times faster than HNSW when both fit in memory

At 100 million vectors on the 768 GiB machine, Tiger Data's 15 July run shows PRISM at 5.8 ms median for 96.5% recall@10 and HNSW at 11.0 ms for 96.3%. PRISM is ahead at every recall level: 1.7x to 2x at 93% to 96% recall, about 3x at 98% and above. The post's 23x and 40x query figures come from 1 million vectors on 2 to 4 GiB machines, where the 2 GB HNSW index did not fit in RAM.

That second case is real and is PRISM's best argument. On a 128 GiB machine PRISM served about 95% recall at 6 ms, while an HNSW index built elsewhere and served from that machine took more than a second per query. PRISM's index for 100 million vectors is 25 GB against 180 GB for HNSW, because PRISM keeps full vectors in the table and reranks from there; the table itself is the same size for both.

pgvector also caps hnsw.ef_search at 1,000, which held HNSW to 98.5% recall at 100 million vectors in these runs. PRISM passed 99% at about 21 ms and topped out at 99.7%. If you need 99% recall at that scale, that is a reason to look.

All of these are Tiger Data's numbers on one dataset, measured with a single client. No independent rerun had been published by 17 October.

Tiger Data's benchmark ran no filtered queries

Every query in Tiger Data's benchmark is a plain ORDER BY ... LIMIT k with no WHERE clause, so the published numbers say nothing about filtered vector search. That matters because most production queries filter by tenant, type or date. pg_vectorsearch applies a filter after its top-k and, per its own changelog, "can return fewer rows than LIMIT", with issue #188 open since August.

pgvector handled the same problem in 0.8.0 with iterative index scans, which keep scanning until enough rows match or a limit is hit. pg_vectorsearch's tuning guide suggests a partial index on the filter, and the launch post lists streaming filtered search as planned for general availability. Gabriel Anhaia flagged the gap the day after launch.

No managed Postgres service offers pg_vectorsearch yet

As of 17 October 2026, pg_vectorsearch is not on the extension lists of AWS RDS and Aurora, Google Cloud SQL and AlloyDB, Azure Database for PostgreSQL, Supabase, Neon or Tiger Data's own Tiger Cloud. pgvector is on all of them. Using pg_vectorsearch today means running Postgres 18 yourself and building the extension from source.

A Tiger Data employee wrote on Hacker News that "you can always move to tiger cloud if you want it managed"; Tiger Cloud's extension page lists pgvectorscale but not pg_vectorsearch. Each big provider also ships its own answer to the memory problem: Azure has pg_diskann, AlloyDB has ScaNN, and AWS points to Aurora Optimized Reads, which caches on local NVMe.

What switching from pgvector to pg_vectorsearch costs

Switching from pgvector to pg_vectorsearch is an index swap, not a data migration, once you are on Postgres 18. PRISM reads pgvector's vector and halfvec columns as they are, and queries using pgvector's operators work unchanged. The costs are the Postgres upgrade, expression indexes, the tuning settings and the extra maintenance under churn.

From the pg_vectorsearch README, with the plan output it shows left out:

-- Install pg_vectorsearch next to pgvector and build the index on the
-- existing column. The column is not rewritten or copied.
CREATE EXTENSION pg_vectorsearch;

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

-- Your queries keep working as before. PRISM is normally faster, so
-- the planner should prefer it over the HNSW index while both exist.
-- Verify with an EXPLAIN:
EXPLAIN (COSTS OFF)
SELECT id, body
FROM documents
ORDER BY embedding <-> (SELECT embedding FROM documents WHERE id = 42)
LIMIT 10;

-- Once you are happy with it, drop the HNSW index.
DROP INDEX documents_embedding_hnsw;

The operator classes map one to one: vector_<metric>_ops becomes vec32_<metric>_ops and halfvec_<metric>_ops becomes vec16_<metric>_ops. The query knob changes from hnsw.ef_search to prism.nprobe, where 0 means automatic, aimed at about 95% recall.

What else changes:

  • Expression indexes. A common pgvector setup, and the one Tiger Data benchmarked, indexes (embedding::halfvec(N)). PRISM refuses expression indexes, so you index the full column or convert it to halfvec, and queries that cast change with it.
  • Load first, index after. PRISM sizes its partitions from the row count at CREATE INDEX and is not recommended on an empty table filled afterwards, which does not suit schema migrations that create indexes before data arrives.
  • Churn. Rows inserted after the build get no boundary copy, deleted space comes back only on REINDEX, and Freedman wrote that "for workloads with substantial churn, REINDEX is still needed".
  • Upgrades. There is no upgrade path from the release candidates; Tiger Data says upgrades between final releases will ship an upgrade script from 0.1.0 on.

Rollback is cheap: both extensions run in one database, so you can keep the HNSW index until EXPLAIN shows PRISM in use and the recall checks pass.

BM25 next to vectors in the same database

Keyword search with BM25 ranking and vector search can share one Postgres database, and reciprocal rank fusion merges the two result lists in plain SQL. Two extensions provide BM25: ParadeDB's pg_search and Tiger Data's pg_textsearch. Either sits next to a pgvector or PRISM index.

The choice is mostly about where you run Postgres. pg_textsearch uses the PostgreSQL licence and is on Cloud SQL, AlloyDB and Tiger Cloud. pg_search is AGPL-3.0 in its community edition, which "supports single-node deployments", and is not on the managed lists checked; ParadeDB documents running it as a logical replica of a managed primary. pg_search also indexes vectors itself, in beta.

On speed, Alex Georgiev measured a ten-term search falling from about 129 ms to 29 ms between pg_search 0.25.11 and 0.26.0, while a single-term search got about five times slower. The test ran in Docker containers on a host the article does not describe, and the published script makes 500,000 rows where the article says three million.

When a separate vector store is the right slot

A Postgres extension is the wrong slot when the index outgrows one machine, when writes are heavy and constant, or when every query is scoped to one of many tenants. pgvector's README sends horizontal scale to replicas or sharding tools such as Citus, and Tiger Data's launch post lists parallel query, multi-tenant indexes and a billion-vector test as later work.

Below that, keeping vectors in Postgres keeps one backup, one permission model and one transaction around them. On Stackness, 6 public profiles list PostgreSQL as of 17 October 2026 and 3 of those also list Supabase; none list ParadeDB, pgvector or a separate vector store yet (data sources). The sample is small. The rest of the DevOps and infrastructure tools developers list is one click away.

Pick pgvector if, pick pg_vectorsearch if

Pick pgvector if:

  • you run a managed Postgres service, or any version before 18
  • your queries filter by tenant, type or date
  • your HNSW graph fits in RAM and builds in an acceptable window
  • you need L1, Hamming or Jaccard distance, sparse vectors, or more than 1,968 dimensions
  • the index has to be in production this quarter

Pick pg_vectorsearch, on a test copy first, if:

  • you self-host Postgres 18
  • your HNSW graph no longer fits in RAM and queries have slowed to hundreds of milliseconds
  • HNSW rebuilds take hours and block deploys
  • you need 99% recall at 100 million vectors, which HNSW did not reach in Tiger Data's runs
  • your writes come in batches you can follow with a REINDEX

New posts by email

About one email a week with what we published. No account needed.

One email to confirm first. Every email has a one-click unsubscribe.

Which of these do you use?

Nobody on Stackness runs pgvector yet. Tick what you use and be the first.

Lonny skating the lakeside path, kickflipping onto a bench, grinding it and flipping offStackness gamesPlay Lonny Eagle Amateur Skater 4A pixel art skateboarding game. Signing up opens it straight away.+2 secret games you unlock as you goSign up to play