From: michaelbautin (@michaelbautin) <noreply+michaelbautin@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] PR #775: Change NOTICE to WARNING when HNSW graph does not fit in memory during build
Date: Wed, 12 Feb 2025 21:58:41 +0000
Message-ID: <gh-pgvector-pgvector-775@github.com> (raw)
This should help prevent cases where users wait for a very long time (24+ hours) for index build because they have not configured the maintenance work memory correctly, as happened in #300 and #504.
inline patch 1: src/hnswbuild.c (+1/-1 lines) download inline-1.patchdiff --git a/src/hnswbuild.c b/src/hnswbuild.cindex b667478b6..26491ab63 100644--- a/src/hnswbuild.c+++ b/src/hnswbuild.c@@ -519,7 +519,7 @@ InsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heaptid, Hn
if (!graph->flushed)
{
- ereport(NOTICE,+ ereport(WARNING,
(errmsg("hnsw graph no longer fits into maintenance_work_mem after " INT64_FORMAT " tuples", (int64) graph->indtuples),
errdetail("Building will take significantly more time."),
errhint("Increase maintenance_work_mem to speed up builds.")));