mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-02 18:50:56 +08:00
Added HNSW_VACUUM_PROGRESS flag [skip ci]
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user