mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 14:46:56 +08:00
Zero memory for each element
This commit is contained in:
@@ -267,6 +267,9 @@ WriteNeighborTuples(HnswBuildState * buildstate)
|
|||||||
/* Update iterator */
|
/* Update iterator */
|
||||||
iter = e->next;
|
iter = e->next;
|
||||||
|
|
||||||
|
/* Zero memory for each element */
|
||||||
|
MemSet(ntup, 0, HNSW_TUPLE_ALLOC_SIZE);
|
||||||
|
|
||||||
/* Can take a while, so ensure we can interrupt */
|
/* Can take a while, so ensure we can interrupt */
|
||||||
/* Needs to be called when no buffer locks are held */
|
/* Needs to be called when no buffer locks are held */
|
||||||
CHECK_FOR_INTERRUPTS();
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|||||||
@@ -208,6 +208,9 @@ RepairGraphElement(HnswVacuumState * vacuumstate, HnswElement element, HnswEleme
|
|||||||
/* Find neighbors for element, skipping itself */
|
/* Find neighbors for element, skipping itself */
|
||||||
HnswFindElementNeighbors(base, element, entryPoint, index, procinfo, collation, m, efConstruction, true);
|
HnswFindElementNeighbors(base, element, entryPoint, index, procinfo, collation, m, efConstruction, true);
|
||||||
|
|
||||||
|
/* Zero memory for each element */
|
||||||
|
MemSet(ntup, 0, HNSW_TUPLE_ALLOC_SIZE);
|
||||||
|
|
||||||
/* Update neighbor tuple */
|
/* Update neighbor tuple */
|
||||||
/* Do this before getting page to minimize locking */
|
/* Do this before getting page to minimize locking */
|
||||||
HnswSetNeighborTuple(base, ntup, element, m);
|
HnswSetNeighborTuple(base, ntup, element, m);
|
||||||
|
|||||||
Reference in New Issue
Block a user