-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification about pre-filtering performance #113
Comments
Thanks for your interest! The actual performance of filtering depends on how tight your condition is:
Currently pgvector on hnsw index is doing the post filtering. Therefore when the filter is not loose enough, the recall drops rapidly, because index cannot provide sufficient results. User need to manually increase the We have done the benchmark on the laion dataset with filter. This is the only real world dataset we can find that has filtering test. Basically you don't need to manually tune any parameter to get reasonable good results with filtering. Under the same configuration, pgvector can only achieve about 50% precision, as well as pgvecto.rs can achieve 95% precision with higher QPS. |
Currently we don't have time to carefully benchmark each mode, so we let user to select it on their own based on their data. Ideally we can select the best plan for the users in the future. To select different mode: |
We are also implementing a new method that retrieves the bitmap from the filter condition and indexed column. This allows us to push down the bitmap to enhance performance in the vector search process. Please stay tuned! |
Thank you for the detailed explanation (and of course for working on this great project)! I have a better sense of the pros/cons now. I'm planning on testing pgvecto.rs soon and will let you know how it goes. Besides performance, there are some things in particular I want to make sure get handled, like changing the dimension size and not creating the index when the table is empty (I read that the index crashes in this case). |
@mertalev We're looking forward to your feedback! Yes, currently create index on empty table doesn't work well and dimension size cannot be changed after column creation. Another point worth attention is the capacity parameters. Current pgvecto.rs needs to predefine a |
I've been testing pgvecto.rs over the last few days and it's very nice! With the latest release, it now handles empty tables so that makes migration easier. From comparison with pgvector:
Ease-of-use improvements:
|
|
Quantization uses lower memory. By default it uses 1/4 memory compared before. |
I was using the |
Thanks for your detailed feedback and it's super valuable to us! As usamoi explained, we just fixed the capacity problem this week so that user doesn't need to take care of it any more. And we'll work on prepare the arm64 image and more pg versions. For quantization, you may also want to check the precision if needed. This can be accomplished by simply using brute force mode and comparing the results between them. |
Hi! I'm looking at both pgvecto.rs and pgvector, and I think pre-filtering support is a killer feature that makes this project appealing.
But the README seems to recommend against using it in the filtering section. Instead, it suggests applying post-filtering for better optimization.
Could you clarify what optimization issues there are with pre-filtering? Relatedly, I think it would be helpful to add a performance comparison between pre-filtering and post-filtering.
The text was updated successfully, but these errors were encountered: