pg.ddx.io pgvector/pgvector GitHub issues and pull requestshelp / color / mirror / Atom feed
[pgvector/pgvector] issue #865: Request to Increase ef_search Maximum Value Beyond 1000 3+ messages / 2 participants [nested] [flat]
* [pgvector/pgvector] issue #865: Request to Increase ef_search Maximum Value Beyond 1000 @ 2025-07-01 09:36 "cho-thinkfree-com (@cho-thinkfree-com)" <noreply+cho-thinkfree-com@github.com> 0 siblings, 0 replies; 3+ messages in thread From: cho-thinkfree-com (@cho-thinkfree-com) @ 2025-07-01 09:36 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> I would like to request consideration for increasing the maximum value of `ef_search` beyond the current limit of 1000. My testing shows significant performance improvements with higher values, particularly when using quantized vectors in a two-stage search approach. I'm working with float16 vectors in 128 dimensions, using bit quantization to compress the data to 16 bytes. I've been experimenting with different search strategies to optimize both performance and accuracy. # Test Results I conducted several experiments to compare search accuracy across different approaches: ## Method 1: Standard Dense Search * Used float16 vectors with 128 dimensions * Created HNSW cosine index * Result: Found 413 target documents ## Method 2: Quantized Search Only * Used bit-quantized data with Hamming distance * Set ef_search = 1000 * Result: Found 193 target documents ## Method 3: Two-Stage Search (Quantized + Float16) * First stage: Quantized search with ef_search = 1000 → retrieved 1000 candidates * Second stage: Re-ranked using float16 cosine similarity * Result: Found 294 target documents ## Method 4: Two-Stage Search with Higher ef_search (using Vespa) Since pgvector limits ef_search to 1000, I tested with Vespa to validate the hypothesis: * First stage: Quantized search with ef_search = 4000 → retrieved 4000 candidates * Second stage: Re-ranked using float16 cosine similarity * Result: Found 400 target documents # Analysis The results show a clear improvement in recall as ef_search increases: * Method 1 (ef_search=1000, float16 hnsw ): 413 documents * Method 2 (ef_search=1000, quantized only): 193 documents * Method 3 (ef_search=1000, two-stage): 294 documents * Method 4 (ef_search=4000, two-stage): 400 documents The two-stage approach with higher ef_search values approaches the performance of the full float16 search (413 documents) while maintaining the storage and initial search speed benefits of quantization. # Request Would it be possible to increase the maximum ef_search value beyond 1000? ## Use Case This would be particularly valuable for: * Two-stage search pipelines using quantized vectors * Applications requiring high recall where the additional computational cost is acceptable * Scenarios with low-dimensional dense vectors and very large document collections, where higher ef_search values become necessary to maintain search quality Thank you for considering this request, and thank you for the excellent work on pgvector! ^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #865: Request to Increase ef_search Maximum Value Beyond 1000 @ 2025-07-01 11:11 ` "ankane (@ankane)" <noreply+ankane@github.com> 1 sibling, 0 replies; 3+ messages in thread From: ankane (@ankane) @ 2025-07-01 11:11 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> Hi @cho-thinkfree-com, you can use [iterative scanning](https://github.com/pgvector/pgvector?tab=readme-ov-file#iterative-index-scans) to get more than 1,000 results (it's not exactly the same as increasing `ef_search`, but should be adjustable enough to achieve similar recall). ^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #865: Request to Increase ef_search Maximum Value Beyond 1000 @ 2025-07-03 13:50 ` "ankane (@ankane)" <noreply+ankane@github.com> 1 sibling, 0 replies; 3+ messages in thread From: ankane (@ankane) @ 2025-07-03 13:50 UTC (permalink / raw) To: pgvector/pgvector <noreply+pgvector-pgvector@github.com> @ankane closed this. ^ permalink raw [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-07-03 13:50 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-07-01 09:36 [pgvector/pgvector] issue #865: Request to Increase ef_search Maximum Value Beyond 1000 "cho-thinkfree-com (@cho-thinkfree-com)" <noreply+cho-thinkfree-com@github.com> 2025-07-01 11:11 ` "ankane (@ankane)" <noreply+ankane@github.com> 2025-07-03 13:50 ` "ankane (@ankane)" <noreply+ankane@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