logoalt Hacker News

Pg_vectorsearch: An index that is faster than pgvector's IVFFlat and HNSW

123 points • by jascha_eng • today at 11:47 AM • 37 comments • view on HN

Comments

devy • today at 1:52 PM

A couple preliminary findings if you are considering adopting this extension to replace your previous pgvector's HNSW indexing.

- pg_vectorsearch uses a quantized IVF index called PRISM. PRISM caps at 1968 dimensions for vectors. If your previous HNSW index has more dimensions than that, you're SOL (at least for now until they fix that).

- pg_vectorsearch requires Postgres version 18 or above. If you run PG versions below that you need to migrate your database first. Many legacy PG production environment are way dated on PG 14 or 15, migration is prohibitively high cost to just try this out.

- pg_vectorsearch shipped yesterday and it's obviously alpha. Hasn't been battle tested in production environments outside of Timescale's. Also since it's so new, it isn't on Azure's allowed-extension list or any other Hyperscale's managed PG instances' allowed extension list. It takes time to graduate from alpha and mature. So if you run managaed PG instances from hyperscaler's cloud, you're SOL (at least for now until this matures into those ecosystems) or you have to migrate to a PG 18 self-hosted.

➕ show 2 replies
arunmu • today at 4:32 PM

Didn't these guys also write pgvectorscale which seems to be unmaintained now ? Why a new index instead of adding onto or improving pgvectorscale?

EgregiousCube • today at 12:43 PM

I'm currently running VectorChord and I love it - with a fast backing disk, it's cut my postgres cost in half. Excited to see competition in low-RAM vector index tools. RAMageddon seems to be creating incentives to find more ways to take advantage of how fast modern nvme drives are!

➕ show 1 reply
Rapzid • today at 12:20 PM

Does it support filtering though?

Edit: post filtering only

I don't understand how people are efficiently implementing tenant/user/permission scopes with these indexes.

➕ show 4 replies
ilumanty • today at 1:48 PM

It would be so awesome if SQLite supported anything along these lines.

➕ show 3 replies
thomasahle • today at 2:35 PM

How does it compare to Roar graph? https://github.com/matchyc/RoarGraph

dmix • today at 2:12 PM

I'm curious how it compares to `pg_search` https://www.paradedb.com/blog/introducing-search

➕ show 1 reply
alexpadula • today at 1:23 PM

Dark side of the PRISM! The image on the repo 100% inspired by Dark Side of The Moon by Pink Floyd.

swe_dima • today at 12:54 PM

Sadly if cloud providers don't offer it on managed postgres then not many people can use it...

➕ show 1 reply
jakobedding • today at 1:41 PM

How does this compare to pgvectorscale?

➕ show 1 reply
jascha_eng • today at 11:55 AM

from the accompanying blog post: https://www.tigerdata.com/blog/announcing-pg_vectorsearch-sc...

> TLDR: We are launching pg_vectorsearch, a new open-source PostgreSQL extension that makes vector search dramatically faster and more cost-efficient. Its new PRISM index uses partitioning and compression instead of HNSW's graph-based approach, delivering faster queries with a fraction of the memory and significantly faster index builds. At 100 million vectors, PRISM achieved 6 ms query latency on a machine with 4× less memory than HNSW, with index builds over 20× faster.

➕ show 1 reply
esafak • today at 12:57 PM

Shouldn't you lead with your benchmarks if you're fast? qps and precision/recall, please.

➕ show 1 reply
ferozelalani • today at 3:40 PM

[flagged]

latencyharbor • today at 3:38 PM

[flagged]

arbor-group • today at 1:58 PM

[flagged]

hushpadapp • today at 12:17 PM

[flagged]

srameshonline • today at 2:01 PM

[flagged]