pgvector.git / summary / log / commit / refs

commit    fc45231ef05395f833f8070720b274eff7a24bf2
Author:   Andrew Kane <andrew@ankane.org>
Date:     Fri Aug 11 21:56:46 2023 +0000

    Improving naming [skip ci]


src/hnswinsert.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hnswinsert.c b/src/hnswinsert.c index 7c8a7adf..7d55df0c 100644 --- a/src/hnswinsert.c +++ b/src/hnswinsert.c @@ -122,7 +122,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag Size maxSize; Size minCombinedSize; HnswElementTuple etup; - BlockNumber originalInsertPage = insertPage; + BlockNumber currentPage = insertPage; int dimensions = e->vec->dim; HnswNeighborTuple ntup; Buffer nbuf; @@ -149,7 +149,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag /* Find a page (or two if needed) to insert the tuples */ for (;;) { - buf = ReadBuffer(index, insertPage); + buf = ReadBuffer(index, currentPage); LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); state = GenericXLogStart(index); @@ -157,7 +157,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag /* Keep track of first page where element at level 0 can fit */ if (!BlockNumberIsValid(newInsertPage) && PageGetFreeSpace(page) >= minCombinedSize) - newInsertPage = insertPage; + newInsertPage = currentPage; /* First, try the fastest path */ /* Space for both tuples on the current page */ @@ -186,9 +186,9 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag break; } - insertPage = HnswPageGetOpaque(page)->nextblkno; + currentPage = HnswPageGetOpaque(page)->nextblkno; - if (BlockNumberIsValid(insertPage)) + if (BlockNumberIsValid(currentPage)) { /* Move to next page */ GenericXLogAbort(state); @@ -277,7 +277,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag UnlockReleaseBuffer(nbuf); /* Update the insert page */ - if (BlockNumberIsValid(newInsertPage) && newInsertPage != originalInsertPage) + if (BlockNumberIsValid(newInsertPage) && newInsertPage != insertPage) *updatedInsertPage = newInsertPage; } [parent: 0191a90f9fbc]