pgvector.git / summary / log / commit / refs

commit    aec853dc68d0cf2d47a1648c39a008207dc19c8c
Author:   Andrew Kane <andrew@ankane.org>
Date:     Thu Apr 04 21:37:39 2024 +0000

    Added memory usage for HNSW index scans [skip ci]


src/hnswscan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hnswscan.c b/src/hnswscan.c index 8dd4efda..3bd0b8f7 100644 --- a/src/hnswscan.c +++ b/src/hnswscan.c @@ -158,6 +158,10 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir) UnlockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock); so->first = false; + +#if defined(HNSW_MEMORY) && PG_VERSION_NUM >= 130000 + elog(INFO, "memory: %zu MB", MemoryContextMemAllocated(so->tmpCtx, false) / (1024 * 1024)); +#endif } while (list_length(so->w) > 0) [parent: 2d24d65f1c28]