pgvector.git / summary / log / commit / refs
commit 8a312c3c8e403c0602bba9ea273bed25db9e58ee
Author: Andrew Kane <andrew@ankane.org>
Date: Sun Aug 25 04:30:40 2024 +0000
Added memory usage for IVFFlat index scans [skip ci]
src/ivfscan.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/ivfscan.c b/src/ivfscan.c
index 03f743df..a8bea0d5 100644
--- a/src/ivfscan.c
+++ b/src/ivfscan.c
@@ -11,6 +11,10 @@
#include "pgstat.h"
#include "storage/bufmgr.h"
+#ifdef IVFFLAT_MEMORY
+#include "utils/memutils.h"
+#endif
+
/*
* Compare list distances
*/
@@ -327,6 +331,10 @@ ivfflatgettuple(IndexScanDesc scan, ScanDirection dir)
IvfflatBench("GetScanItems", GetScanItems(scan, value));
so->first = false;
+#if defined(IVFFLAT_MEMORY) && PG_VERSION_NUM >= 130000
+ elog(INFO, "memory: %zu MB", MemoryContextMemAllocated(CurrentMemoryContext, true) / (1024 * 1024));
+#endif
+
/* Clean up if we allocated a new value */
if (value != scan->orderByData->sk_argument)
pfree(DatumGetPointer(value));
[parent: 5d86b177abcf]