From 3d568ef6a15254ff037022dca963aef8abf3d25d Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 11 Aug 2023 21:12:18 -0700 Subject: [PATCH] Added comments [skip ci] --- src/hnswinsert.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hnswinsert.c b/src/hnswinsert.c index 90f944a..2ad1900 100644 --- a/src/hnswinsert.c +++ b/src/hnswinsert.c @@ -307,11 +307,14 @@ UpdateNeighborPages(Relation index, FmgrInfo *procinfo, Oid collation, HnswEleme int startIdx; OffsetNumber offno = hc->element->neighborOffno; - /* Get latest neighbors */ + /* Get latest neighbors since they may have changed */ + /* Do not lock yet since selecting neighbors can take time */ HnswLoadNeighbors(hc->element, index); + /* Select neighbors */ HnswUpdateConnection(e, hc, lm, lc, &idx, index, procinfo, collation); + /* New element was not selected as a neighbor */ if (idx == -1) continue;