mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-09 22:30:58 +08:00
Improved logic
This commit is contained in:
@@ -769,11 +769,19 @@ SelectNeighbors(List *c, int m, int lc, FmgrInfo *procinfo, Oid collation, HnswE
|
|||||||
|
|
||||||
w = list_delete_last(w);
|
w = list_delete_last(w);
|
||||||
|
|
||||||
if (!mustCalculate)
|
|
||||||
mustCalculate = e->element == e2->neighbors[lc].firstPruned || e == newCandidate;
|
|
||||||
|
|
||||||
if (mustCalculate)
|
if (mustCalculate)
|
||||||
closer = CheckElementCloser(e, r, lc, procinfo, collation);
|
closer = CheckElementCloser(e, r, lc, procinfo, collation);
|
||||||
|
else if (e->element == e2->neighbors[lc].firstPruned)
|
||||||
|
{
|
||||||
|
closer = false;
|
||||||
|
/* TODO Store multiple pruned and only calculate when exhausted */
|
||||||
|
mustCalculate = true;
|
||||||
|
}
|
||||||
|
else if (e == newCandidate)
|
||||||
|
{
|
||||||
|
closer = CheckElementCloser(e, r, lc, procinfo, collation);
|
||||||
|
mustCalculate = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
closer = true;
|
closer = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user