Update neighbors when vacuuming

This commit is contained in:
Andrew Kane
2023-08-13 16:17:30 -07:00
parent 6fc7d06313
commit 0f238b1fa9
3 changed files with 5 additions and 1 deletions

View File

@@ -268,6 +268,7 @@ void HnswSetNeighborTuple(HnswNeighborTuple ntup, HnswElement e, int m);
void HnswAddHeapTid(HnswElement element, ItemPointer heaptid);
void HnswInitNeighbors(HnswElement element, int m);
bool HnswInsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heap_tid, Relation heapRel);
void UpdateNeighborPages(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement e, int m);
void HnswLoadElement(HnswElement element, float *distance, Datum *q, Relation index, FmgrInfo *procinfo, Oid collation, bool loadVec);
void HnswSetElementTuple(HnswElementTuple etup, HnswElement element);
void HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int *updateIdx, Relation index, FmgrInfo *procinfo, Oid collation);

View File

@@ -286,7 +286,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag
/*
* Update neighbors
*/
static void
void
UpdateNeighborPages(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement e, int m)
{
for (int lc = e->level; lc >= 0; lc--)

View File

@@ -253,6 +253,9 @@ RepairGraphElement(HnswVacuumState * vacuumstate, HnswElement element)
MarkBufferDirty(buf);
GenericXLogFinish(state);
UnlockReleaseBuffer(buf);
/* Update neighbors */
UpdateNeighborPages(index, procinfo, collation, element, m);
}
/*