From 8a81a3fe3ab43698f1a7e25e8e60f37a5ac7419e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 16 Jun 2026 13:53:40 -0700 Subject: [PATCH] Added HNSW_VACUUM_PROGRESS flag [skip ci] --- src/hnswvacuum.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c index 4ea076b..2825205 100644 --- a/src/hnswvacuum.c +++ b/src/hnswvacuum.c @@ -480,6 +480,16 @@ RepairGraph(HnswVacuumState * vacuumstate) /* Reset memory context */ MemoryContextSwitchTo(oldCtx); MemoryContextReset(vacuumstate->tmpCtx); + +#ifdef HNSW_VACUUM_PROGRESS + if (!BlockNumberIsValid(blkno) || blkno % 1000 == 0) + { + BlockNumber totalBlocks = RelationGetNumberOfBlocks(index); + BlockNumber currentBlocks = BlockNumberIsValid(blkno) ? blkno : totalBlocks; + + elog(INFO, "hnsw vacuum progress: %.1f%%", 100.0 * currentBlocks / totalBlocks); + } +#endif } }