mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-09 06:10:58 +08:00
Added comments [skip ci]
This commit is contained in:
@@ -423,6 +423,7 @@ BuildCallback(Relation index, CALLBACK_ITEM_POINTER, Datum *values,
|
|||||||
if (isnull[0])
|
if (isnull[0])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Flush pages if needed */
|
||||||
if (!buildstate->flushed && (buildstate->memoryUsed >= buildstate->memoryTotal || list_length(buildstate->elements) == LIST_MAX_LENGTH))
|
if (!buildstate->flushed && (buildstate->memoryUsed >= buildstate->memoryTotal || list_length(buildstate->elements) == LIST_MAX_LENGTH))
|
||||||
{
|
{
|
||||||
if (buildstate->memoryUsed >= buildstate->memoryTotal)
|
if (buildstate->memoryUsed >= buildstate->memoryTotal)
|
||||||
@@ -436,11 +437,13 @@ BuildCallback(Relation index, CALLBACK_ITEM_POINTER, Datum *values,
|
|||||||
|
|
||||||
oldCtx = MemoryContextSwitchTo(buildstate->tmpCtx);
|
oldCtx = MemoryContextSwitchTo(buildstate->tmpCtx);
|
||||||
|
|
||||||
|
/* Insert tuple */
|
||||||
if (buildstate->flushed)
|
if (buildstate->flushed)
|
||||||
inserted = HnswInsertTuple(index, values, isnull, tid, buildstate->heap, true);
|
inserted = HnswInsertTuple(index, values, isnull, tid, buildstate->heap, true);
|
||||||
else
|
else
|
||||||
inserted = InsertTupleInMemory(index, values, tid, buildstate);
|
inserted = InsertTupleInMemory(index, values, tid, buildstate);
|
||||||
|
|
||||||
|
/* Update progress */
|
||||||
if (inserted)
|
if (inserted)
|
||||||
{
|
{
|
||||||
if (buildstate->hnswshared)
|
if (buildstate->hnswshared)
|
||||||
|
|||||||
Reference in New Issue
Block a user