Nice to see people care about index construction time. I'm the lead author of JVector, which scales linearly to at least 32 cores and may be the only graph-based vector index designed around nonblocking data structures (as opposed to using locks for thread safety): https://github.com/jbellis/jvector/ JVector looks to be about 2x as fast at indexing as Lantern, ingesting the Sift1M dataset in under 25s on a 32 core aw…
90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
31–39 of 39 posts
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#32This reads like a marketing piece, not an honest technical blogpost. I agree that Usearch is fast, but it feels pretty dishonest to take credit for someone else's work. Like maybe at least honestly profile what's going on with USearch vs pgvector (..and which settings for pgvector??), and write something interesting about it? The last time I tried Lantern, it'd segfault when I tried to do anything non-trivial with it…
Not sure if it's fair to compare USearch and pgvector. One is an efficient indexing structure, the other is more like a pure database plugin. Not that they can't be used in a similar fashion.
If you are looking for pure indexing benchmarks, you might be interested in USearch vs FAISS HNSW implementation [1]. We run them ourselves (and a couple of other tech companies), so take them with a grain of salt. They might be biased.
As for Lantern vs pgvector, impressed by the result! A lot of people would benefit from having fast vector-search compatible with Postgres! The way to go!
It's wasn't a trivial integration by any means, and the Lantern team was very active - suggesting patches into the upstream version to ease integrations with other databases. Some of those are tricky and have yet to be merged [2]. So stay tuned for the USearch v3. Lots of new features coming :)
[1]: https://www.unum.cloud/blog/2023-11-07-scaling-vector-search... [2]: https://github.com/unum-cloud/usearch/pull/171/files
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#33Earlier quoted context omitted.
Adding to this, the article the GP comment has linked to is for Trusted Language Extensions , which would allow AWS users to run extensions that aren't "officially" installed on RDS however, since Latern is written in C++, it is not a Trusted Language for Postgres. If they instead used Rust (for example), then it would theoretically be able to be used with RDS, since Rust is now a Trusted Language on RDS: https://aws…
My understanding is Trusted Language Extensions refer to extensions written in PL/Rust - a Postgres extension mechanism to write user defined functions and use them in SQL queries. PL/Rust is a more performant and more feature-rich alternative to PL/pgSQL, which is the traditional UDF scripting language for Postgres. Building a vector index (or any index for that matter) inside Postgres is a more involved process and…
Trusted Language Extensions refer to an extension written in any trusted language. In this case Rust, but it also includes: plpgsql, plv8, etc. See [0]
> PL/Rust is a more performant and more feature-rich alternative to PL/pgSQL
This is only partially true. plpgsql has bindings to low-level Postgres APIs, so in some cases it is just as fast (or faster) than Rust.
> Building a vector index (or any index for that matter) inside Postgres is a more involved process and can not be done via the UDF interface, be it Rust, C or PL/pgSQL
Most PG Rust extensions are written with the excellent pgrx framework [1]. While it doesn't have index bindings right now, I can certainly imagine a future where this is possible[2].
All that said - I think there are a lot of hoops to jump through right now and I doubt it's worth it for your team. I think you are right to focus on developing a separate C extension
[0] TLE: https://supabase.com/blog/pg-tle
[1] pgrx: https://github.com/pgcentralfoundation/pgrx
[2] https://github.com/pgcentralfoundation/pgrx/issues/190#issue...
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#34How does performance scale (vs pgvector) when you have an index and start loading data in parallel? Or how does this scale vs the to-be-released pgvector 0.5.2?
We haven't benchmarked against 0.5.2 yet so I can't share exact numbers. We will benchmark it once it is released. We think our approach will still significantly outperform pgvector because it does less on your production database. We generate the index remotely, on a compute-optimized machine, and only use your production database for index copy. Parallel pgvector would have to use your production database resources…
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#35Earlier quoted context omitted.
We haven't benchmarked against 0.5.2 yet so I can't share exact numbers. We will benchmark it once it is released. We think our approach will still significantly outperform pgvector because it does less on your production database. We generate the index remotely, on a compute-optimized machine, and only use your production database for index copy. Parallel pgvector would have to use your production database resources…
which version of pgvector are you using for these benchmarks?
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#36Earlier quoted context omitted.
which version of pgvector are you using for these benchmarks?
We used 0.5.0 for these
https://x.com/pgvector/status/1711910075416432785?s=46
Do you have the code you used so that we can reproduce these results?
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#37Nice to see people care about index construction time. I'm the lead author of JVector, which scales linearly to at least 32 cores and may be the only graph-based vector index designed around nonblocking data structures (as opposed to using locks for thread safety): https://github.com/jbellis/jvector/ JVector looks to be about 2x as fast at indexing as Lantern, ingesting the Sift1M dataset in under 25s on a 32 core aw…
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#38Earlier quoted context omitted.
We used 0.5.0 for these
It’s not really a fair comparison in that case: https://x.com/pgvector/status/1711910075416432785?s=46 Do you have the code you used so that we can reproduce these results?
The original post and the experiments were created before pgvector 0.5.1 was out, and we had not realized there was significant work to optimize index creation time in the latest pgvector release.
We reran pgvector benchmarks with pgvector 0.5.1. Now pgvector index creation is on par or 10% faster than lantern on a single core. Lantern still allows 30x faster index creation by leveraging additional cores.
Wiki Pgvector - 36m Lantern - 43m Lantern external indexing (32 CPU): 2m 15s
Sift Pgvector - 12m30s Lantern - 7m Lantern external indexing (32 CPU): 25s
The DB parameters for the above results (both Lantern and pgvector): shared_buffers=12GB maintenance_work_mem=5GB work_mem=2GB
The DB parameters for the previous results were the defaults for both Lantern and pgvector.
Benchmarking was done using psql timing and used a 32CPU/64GB RAM machine (Linode Dedicated 64).
Feel free to reach out if you need anything for benchmarks.
Re: 90x Faster Than Pgvector – Lantern's HNSW Index Creation Time
#39Earlier quoted context omitted.
It’s not really a fair comparison in that case: https://x.com/pgvector/status/1711910075416432785?s=46 Do you have the code you used so that we can reproduce these results?
I added an edited note to the bottom of the blog post. The original post and the experiments were created before pgvector 0.5.1 was out, and we had not realized there was significant work to optimize index creation time in the latest pgvector release. We reran pgvector benchmarks with pgvector 0.5.1. Now pgvector index creation is on par or 10% faster than lantern on a single core. Lantern still allows 30x faster ind…
likewise, feel free to reach out before publishing pgvector benchmarks. i'm sure we will have some tips to make them more impartial