mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-05 12:10:55 +08:00
Use -1 for no limit for ivfflat.max_probes [skip ci]
This commit is contained in:
@@ -259,19 +259,27 @@ ivfflatbeginscan(Relation index, int nkeys, int norderbys)
|
||||
/* Get lists and dimensions from metapage */
|
||||
IvfflatGetMetaPageInfo(index, &lists, &dimensions);
|
||||
|
||||
if (probes > lists)
|
||||
probes = lists;
|
||||
|
||||
if (ivfflat_iterative_search != IVFFLAT_ITERATIVE_SEARCH_OFF)
|
||||
{
|
||||
if (ivfflat_max_probes == 0)
|
||||
maxProbes = ivfflat_max_probes;
|
||||
|
||||
if (maxProbes < 0)
|
||||
maxProbes = lists;
|
||||
else
|
||||
maxProbes = Min(ivfflat_max_probes, lists);
|
||||
else if (maxProbes < probes)
|
||||
{
|
||||
/* TODO Show notice */
|
||||
maxProbes = probes;
|
||||
}
|
||||
}
|
||||
else
|
||||
maxProbes = probes;
|
||||
|
||||
if (probes > lists)
|
||||
probes = lists;
|
||||
|
||||
if (maxProbes > lists)
|
||||
maxProbes = lists;
|
||||
|
||||
so = (IvfflatScanOpaque) palloc(offsetof(IvfflatScanOpaqueData, lists) + maxProbes * sizeof(IvfflatScanList));
|
||||
so->typeInfo = IvfflatGetTypeInfo(index);
|
||||
so->first = true;
|
||||
|
||||
Reference in New Issue
Block a user