pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgvector/pgvector] issue #285: Interest in DiskANN
15+ messages / 10 participants
[nested] [flat]

* [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-09-27 19:27  "save-buffer (@save-buffer)" <noreply+save-buffer@github.com>
  0 siblings, 0 replies; 15+ messages in thread

From: save-buffer (@save-buffer) @ 2023-09-27 19:27 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hi, at Neon we've been investigating DiskANN, and we believe it would have several advantages compared to HNSW. Last month I prototyped a freestanding DiskANN implementation (not inside Postgres, and not the official DiskANN implementation), and seemed to get very good performance for building the index in parallel compared to libhnsw. Timescale recently [published](https://www.timescale.com/blog/how-we-made-postgresql-the-best-vector-database/) their own DiskANN implementation which (at least according to them) outperforms pgvector's HNSW. DiskANN also has an extension called FreshDiskANN which cleanly supports inserts and deletes.  

I was wondering if there was any interest in adding DiskANN to pgvector. If so, I'd like to begin working on it!

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-09-28 14:33  "jkatz (@jkatz)" <noreply+jkatz@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: jkatz (@jkatz) @ 2023-09-28 14:33 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

My 2¢: Interested? Yes, at least academically.

I personally still think there is room to improve on current HNSW/IVFFLAT support in pgvector before adding another algorithm, esp. one that has more parameters for the user to tune. My personal list, which is influenced both from folks using and evaluating pgvector as well as personal experimentation:

- Quantization, esp. product quantization (I do think we also need scalar quantization, but I see PQ raising the performance bar quite a bit)
- Better multi-column filtering techniques (see discussion in https://github.com/pgvector/pgvector/issues/244)
- Support different data types (https://github.com/pgvector/pgvector/tree/hnsw-array lays the groundwork for this -- supporting float2, uint8, etc. will help shrink down some index sizes)
- More parallelism
  - Parallel build for HNSW
  - Parallel query for both IVFFLAT/HNSW (more emphasis on IVFFLAT)
- Incorporating elements of SPANN into IVFFLAT (e.g. overlapping neighborhood searches)

all while maintaining the relative simplicity of pgvector's implementation + usability.

I think all of these are achievable in a relatively short timeframe if folks can focus on them, and it would help achieve some of the aforementioned performance gains before working on adding another algorithm.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-10-04 19:31  "pashkinelfe (@pashkinelfe)" <noreply+pashkinelfe@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: pashkinelfe (@pashkinelfe) @ 2023-10-04 19:31 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I agree with all these features for the near fututure. Except I think parallel scan is not a feature that we need very much: it will speed up single ANN-queries, but for single queries (vs some regular ANN-workload) we’ll be limited with index not being warm in shared buffers. TPS for regular ANN-workload already has a benefit of different queries run simultaneoulsy in different processes.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-10-05 16:44  "cemoody (@cemoody)" <noreply+cemoody@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: cemoody (@cemoody) @ 2023-10-05 16:44 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I'm very much interested for scaling reasons: our stack includes 1B vectors indexed. Tangentially,
@save-buffer I'd love to try out anything y'all are working with.   

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-10-30 04:15  "ankane (@ankane)" <noreply+ankane@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: ankane (@ankane) @ 2023-10-30 04:15 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

Hi @save-buffer, thanks for sharing. As @jkatz mentioned, I think it makes sense to keep pgvector focused on the existing index types right now. What advantages do you see besides potential performance improvements?

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-11-12 18:50  "ankane (@ankane)" <noreply+ankane@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: ankane (@ankane) @ 2023-11-12 18:50 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@ankane closed this.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-11-12 22:09  "jkatz (@jkatz)" <noreply+jkatz@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: jkatz (@jkatz) @ 2023-11-12 22:09 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

On the earlier comment, I've observed 1B vectors indexed and queried using pgvector's HNSW implementation on a single, unpartitioned table. The indexing does take some time but query performance was still subsecond.

This is in part why it's good to work on continued gains in the current index methods before building out new ones, as there's still more headroom in potential performance.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-11-27 18:39  "JackTan25 (@JackTan25)" <noreply+JackTan25@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: JackTan25 (@JackTan25) @ 2023-11-27 18:39 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@save-buffer hope your pr for diskann

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-11-28 07:23  "JackTan25 (@JackTan25)" <noreply+JackTan25@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: JackTan25 (@JackTan25) @ 2023-11-28 07:23 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I think we can support diskann for pgvector firstly although there is performance-improvement room for current indeics. @save-buffer @ankane If agree, I think I'm willing to support diskann for pgvector. Because current memory index can't hold billion vector data, I hope to overcome this shortcoming. Thanks.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2023-11-29 07:09  "jkatz (@jkatz)" <noreply+jkatz@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: jkatz (@jkatz) @ 2023-11-29 07:09 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I currently do not see any reason to support this as I don't think we've hit the ceiling yet on HNSW nor IVFFLAT performance, particularly with a variety of enhancements coming up. I recently shared some [performance results for pgvector and HNSW][1] which are already quite fast, and I think we still have some more room improve both with supporting smaller data types in dimensions, adding support for quantization, and also improvements higher end of `hnsw.ef_search`. Per https://github.com/pgvector/pgvector/issues/285#issuecomment-1807258210 we can take pgvector's HNSW implementation quite far both for some pretty large data access patterns, so I'm not sure why we need an additional algorithm at this point.

There may be a time where it makes sense to add another indexing algorithm, but I've yet to see a convincing argument at this time is now given the relative performance/recall we're getting w/HNSW today.

[1]: https://aws.amazon.com/blogs/database/accelerate-hnsw-indexing-and-searching-with-pgvector-on-amazon...

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2024-01-24 02:03  "lij55 (@lij55)" <noreply+lij55@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: lij55 (@lij55) @ 2024-01-24 02:03 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

timescaledb made a diskann index: https://www.timescale.com/blog/how-we-made-postgresql-the-best-vector-database/

![Timescale-Vector-How-We-Made-PostgreSQL-a-Better-Vector-Database](https://github.com/pgvector/pgvector/assets/12248266/8fe97d68-020b-4d84-9912-aa1c5f178aca)

it seems providing better QPS for the same recall rate.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2024-04-16 06:06  "virtualsafety (@virtualsafety)" <noreply+virtualsafety@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: virtualsafety (@virtualsafety) @ 2024-04-16 06:06 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

https://blog.pgvecto.rs/pgvector-vs-pgvectors-in-2024-a-comprehensive-comparison-for-vector-search-i... , why using same index, pgvecto.rs permform better than pgvector?

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2024-04-16 12:22  "jkatz (@jkatz)" <noreply+jkatz@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: jkatz (@jkatz) @ 2024-04-16 12:22 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

I haven't tested pgvector yet with the LAION datasets (it's actually on my TODO), but some of those results don't match my experience with pgvector and using comparable and significantly larger datasets, particularly the latency values. There are also a few things that are unclear from that blog post, i.e. hardware specifications and PostgreSQL configuration.

It'll also be good to see how pgvector is performing now that it supports quantization to fp16 and, where appropriate, binary quantization with reranking.

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2024-09-25 09:20  "LucaZilli (@LucaZilli)" <noreply+LucaZilli@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: LucaZilli (@LucaZilli) @ 2024-09-25 09:20 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

@cemoody I have seen in the earlier comment that your stack has 1B vectors indexed. May I ask you how much time you took to index such huge dataset and how much memory the final index require?

If is possible I would also like to know what did you do to speed up the indexing performance. How much ram and workers did you use? Did you quantized vectors?

^ permalink  raw  [nested|flat] 15+ messages in thread

* Re: [pgvector/pgvector] issue #285: Interest in DiskANN
@ 2024-11-29 07:37  "osmarks (@osmarks)" <noreply+osmarks@github.com>
  13 siblings, 0 replies; 15+ messages in thread

From: osmarks (@osmarks) @ 2024-11-29 07:37 UTC (permalink / raw)
  To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>

> I haven't tested pgvector yet with the LAION datasets (it's actually on my TODO), but some of those results don't match my experience with pgvector and using comparable and significantly larger datasets, particularly the latency values. There are also a few things that are unclear from that blog post, i.e. hardware specifications and PostgreSQL configuration.

I can't see whether this applies to the dataset in question (plausibly https://sisap-challenges.github.io/2024/datasets/ I guess) easily, but it might be that the queries and dataset are differently distributed (CLIP text encoder versus image encoder) - https://arxiv.org/abs/2408.08933 and some other work says that this makes retrieval performance significantly worse (terrible recall with IVF, slowdown with graph-based approaches).

^ permalink  raw  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2024-11-29 07:37 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27 19:27 [pgvector/pgvector] issue #285: Interest in DiskANN "save-buffer (@save-buffer)" <noreply+save-buffer@github.com>
2023-09-28 14:33 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-10-04 19:31 ` "pashkinelfe (@pashkinelfe)" <noreply+pashkinelfe@github.com>
2023-10-05 16:44 ` "cemoody (@cemoody)" <noreply+cemoody@github.com>
2023-10-30 04:15 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-11-12 18:50 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-11-12 22:09 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-11-27 18:39 ` "JackTan25 (@JackTan25)" <noreply+JackTan25@github.com>
2023-11-28 07:23 ` "JackTan25 (@JackTan25)" <noreply+JackTan25@github.com>
2023-11-29 07:09 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2024-01-24 02:03 ` "lij55 (@lij55)" <noreply+lij55@github.com>
2024-04-16 06:06 ` "virtualsafety (@virtualsafety)" <noreply+virtualsafety@github.com>
2024-04-16 12:22 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2024-09-25 09:20 ` "LucaZilli (@LucaZilli)" <noreply+LucaZilli@github.com>
2024-11-29 07:37 ` "osmarks (@osmarks)" <noreply+osmarks@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox