You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: add minimum probes and maximum probes to IVF search (#3903)
Currently IVF search takes an `nprobes` parameter that selects how many
partitions are searched. This can be a problem with highly selective
prefilters because the partitions closest to the query vector might not
have any results. Setting a larger `nprobes` value will lead to more
results being returned but all queries will be more expensive.
I think we will eventually want to work around this problem through a
combination of column statistics, selectivity estimation, and partition
bloom filters. However, in the short term, this PR splits `nprobes` into
`minimum_nprobes` and `maximum_nprobes`. At first we will search
`minimum_nprobes`, like we do today. If we don't find enough results
after searching those partitions then we will search up to
`maximum_nprobes` partitions until we do.
This PR also changes the default nprobes to 20. The previous default was
1 which was unlikely to give good recall and could set misleading
expectations. The new default of 20 is the same as the default in
lancedb.
We also consider the prefilter max_results, which will allow us to stop
early if we have found all results matching the prefilter.
Also, if the number of prefilter results is very small, we will skip the
late search entirely and just return all prefiltered row ids to be
sorted in the refine stage.
The approach is slightly complex but one of my primary goals is to avoid
impacting our current search performance which relies on our ability to
select partitions and execute the prefilter in parallel (so, for
example, we won't know the actual selectivity until after we've already
loaded several partitions).
BREAKING CHANGE: the default for nprobes is now 20 instead of 1
0 commit comments