mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 22:56:55 +08:00
Renamed HnswInsertElement to HnswFindElementNeighbors [skip ci]
This commit is contained in:
@@ -385,7 +385,7 @@ void HnswGetMetaPageInfo(Relation index, int *m, HnswElement * entryPoint);
|
|||||||
void *HnswAlloc(HnswAllocator * allocator, Size size);
|
void *HnswAlloc(HnswAllocator * allocator, Size size);
|
||||||
HnswElement HnswInitElement(char *base, ItemPointer tid, int m, double ml, int maxLevel, HnswAllocator * alloc);
|
HnswElement HnswInitElement(char *base, ItemPointer tid, int m, double ml, int maxLevel, HnswAllocator * alloc);
|
||||||
HnswElement HnswInitElementFromBlock(BlockNumber blkno, OffsetNumber offno);
|
HnswElement HnswInitElementFromBlock(BlockNumber blkno, OffsetNumber offno);
|
||||||
void HnswInsertElement(char *base, HnswElement element, HnswElement entryPoint, Relation index, FmgrInfo *procinfo, Oid collation, int m, int efConstruction, bool existing);
|
void HnswFindElementNeighbors(char *base, HnswElement element, HnswElement entryPoint, Relation index, FmgrInfo *procinfo, Oid collation, int m, int efConstruction, bool existing);
|
||||||
HnswCandidate *HnswEntryCandidate(char *base, HnswElement em, Datum q, Relation rel, FmgrInfo *procinfo, Oid collation, bool loadVec);
|
HnswCandidate *HnswEntryCandidate(char *base, HnswElement em, Datum q, Relation rel, FmgrInfo *procinfo, Oid collation, bool loadVec);
|
||||||
void HnswUpdateMetaPage(Relation index, int updateEntry, HnswElement entryPoint, BlockNumber insertPage, ForkNumber forkNum, bool building);
|
void HnswUpdateMetaPage(Relation index, int updateEntry, HnswElement entryPoint, BlockNumber insertPage, ForkNumber forkNum, bool building);
|
||||||
void HnswSetNeighborTuple(char *base, HnswNeighborTuple ntup, HnswElement e, int m);
|
void HnswSetNeighborTuple(char *base, HnswNeighborTuple ntup, HnswElement e, int m);
|
||||||
|
|||||||
@@ -472,8 +472,8 @@ InsertTupleInMemory(HnswBuildState * buildstate, HnswElement element)
|
|||||||
updateEntryPoint = entryPoint == NULL || element->level > entryPoint->level;
|
updateEntryPoint = entryPoint == NULL || element->level > entryPoint->level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert element in graph */
|
/* Find neighbors for element */
|
||||||
HnswInsertElement(base, element, entryPoint, NULL, procinfo, collation, m, efConstruction, false);
|
HnswFindElementNeighbors(base, element, entryPoint, NULL, procinfo, collation, m, efConstruction, false);
|
||||||
|
|
||||||
/* Apply changes in memory */
|
/* Apply changes in memory */
|
||||||
ApplyChangesInMemory(procinfo, collation, element, m, efConstruction, entryPoint, buildstate, updateEntryPoint);
|
ApplyChangesInMemory(procinfo, collation, element, m, efConstruction, entryPoint, buildstate, updateEntryPoint);
|
||||||
|
|||||||
@@ -608,8 +608,8 @@ HnswInsertTupleOnDisk(Relation index, Datum value, Datum *values, bool *isnull,
|
|||||||
entryPoint = HnswGetEntryPoint(index);
|
entryPoint = HnswGetEntryPoint(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert element in graph */
|
/* Find neighbors for the element */
|
||||||
HnswInsertElement(base, element, entryPoint, index, procinfo, collation, m, efConstruction, false);
|
HnswFindElementNeighbors(base, element, entryPoint, index, procinfo, collation, m, efConstruction, false);
|
||||||
|
|
||||||
/* Apply changes on disk */
|
/* Apply changes on disk */
|
||||||
ApplyChangesOnDisk(index, procinfo, collation, element, m, efConstruction, entryPoint, building);
|
ApplyChangesOnDisk(index, procinfo, collation, element, m, efConstruction, entryPoint, building);
|
||||||
|
|||||||
@@ -1216,7 +1216,7 @@ PrecomputeHash(char *base, HnswElement element)
|
|||||||
* Algorithm 1 from paper
|
* Algorithm 1 from paper
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HnswInsertElement(char *base, HnswElement element, HnswElement entryPoint, Relation index, FmgrInfo *procinfo, Oid collation, int m, int efConstruction, bool existing)
|
HnswFindElementNeighbors(char *base, HnswElement element, HnswElement entryPoint, Relation index, FmgrInfo *procinfo, Oid collation, int m, int efConstruction, bool existing)
|
||||||
{
|
{
|
||||||
List *ep;
|
List *ep;
|
||||||
List *w;
|
List *w;
|
||||||
|
|||||||
@@ -208,8 +208,8 @@ RepairGraphElement(HnswVacuumState * vacuumstate, HnswElement element, HnswEleme
|
|||||||
HnswInitNeighbors(NULL, element, m, NULL);
|
HnswInitNeighbors(NULL, element, m, NULL);
|
||||||
element->heaptidsLength = 0;
|
element->heaptidsLength = 0;
|
||||||
|
|
||||||
/* Add element to graph, skipping itself */
|
/* Find neighbors for element, skipping itself */
|
||||||
HnswInsertElement(NULL, element, entryPoint, index, procinfo, collation, m, efConstruction, true);
|
HnswFindElementNeighbors(NULL, element, entryPoint, index, procinfo, collation, m, efConstruction, true);
|
||||||
|
|
||||||
/* Update neighbor tuple */
|
/* Update neighbor tuple */
|
||||||
/* Do this before getting page to minimize locking */
|
/* Do this before getting page to minimize locking */
|
||||||
|
|||||||
Reference in New Issue
Block a user