diff --git a/src/hnswbuild.c b/src/hnswbuild.c index 8f4e0c7..36b44bf 100644 --- a/src/hnswbuild.c +++ b/src/hnswbuild.c @@ -383,7 +383,7 @@ BuildCallback(Relation index, CALLBACK_ITEM_POINTER, Datum *values, if (isnull[0]) return; - if (buildstate->memoryLeft <= 0 || list_length(buildstate->elements) == LIST_MAX_LENGTH) + if (buildstate->flushed || buildstate->memoryLeft <= 0 || list_length(buildstate->elements) == LIST_MAX_LENGTH) { if (!buildstate->flushed) {