Uh oh!
There was an error while loading. Please reload this page.
feat: fixed-effort search parameters for cross-engine parity - #2
Open
Saccilotto wants to merge 1 commit into
Open
feat: fixed-effort search parameters for cross-engine parity#2Saccilotto wants to merge 1 commit into
Saccilotto wants to merge 1 commit into
Conversation
WITH TARGET ACCURACY PARAMETERS (EFSEARCH n) on HNSW and (NEIGHBOR PARTITION PROBES n) on IVF -- the direct analogues of pgvector's ef_search/probes, so cross-engine runs can compare identical search effort instead of adaptive accuracy vs fixed effort. Exposed as --ef-search / --neighbor-partition-probes CLI options and Streamlit inputs; unset (or 0) keeps the adaptive TARGET ACCURACY behaviour unchanged. Both syntaxes verified live on Oracle 23.26.1 (Free): EFSEARCH 128 on Performance1536D50K/HNSW gives recall 0.9803 at 508 qps vs 0.996 at 344 qps with the adaptive default.
Saccilotto
requested review from
ArturMarcon, Davi-K-Silva, Julioau and aloysiowinterAugust 22, 2026 01:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1 — review that first; this pull request shows only the parity commit.
Problem
Oracle and pgvector answer approximate search under different contracts, and the client only exposed one of them.
Oracle's approximate search is driven by an adaptive accuracy target: "return results at least this accurate", with the engine deciding how much work that takes. pgvector is driven by fixed effort:
ef_searchandprobessay exactly how much work to do, and the accuracy follows.Comparing the two as shipped compares an engine that adapts per query against one that does not. Whatever difference appears in recall or QPS is not attributable to the engines — it is partly an artefact of the contract each was asked to honour. Oracle does support fixed-effort search; the client simply had no way to ask for it.
Change
Two opt-in options that reach the fixed-effort forms of Oracle's search clause:
--ef-searchon HNSW, emittingWITH TARGET ACCURACY PARAMETERS (EFSEARCH n)— the direct analogue of pgvector'sef_search--neighbor-partition-probeson IVF, emitting(NEIGHBOR PARTITION PROBES n)— the analogue of pgvector'sprobesBoth are unset by default, and
0is accepted as an explicit "stay adaptive", so the existing target-accuracy behaviour is untouched unless a run asks otherwise. The same parameters appear in the UI configuration.Validation
On a live Oracle 23.26.1 instance,
Performance1536D50Kon HNSW:EFSEARCH 128That is the trade-off the parity comparison needs to be able to observe, and it is invisible without these options. Both SQL forms were verified against 23.26.1 before being wired in; unit tests cover the sentinel and the parameter emission.
Terms, for review
TARGET ACCURACY(adaptive): Oracle's default search contract — fix the quality ("≥95% accurate"), spend whatever work it takes per query.EFSEARCH/NEIGHBOR PARTITION PROBES(fixed effort): fix the work — candidates examined on the HNSW graph / partitions opened in IVF — and let accuracy follow. This is exactly pgvector'sef_search/probescontract, which is why exposing it makes Oracle-vs-pgvector runs comparable like-for-like.EFSEARCH 1280.980 @ 508 qps — is the behaviour the option exists to expose.Part of GRINPROJS-PUCRS/expdb#367