Skip to content

Commit 02b01e1

Browse files
committed
Show tuples with memory usage [skip ci]
1 parent 388e42f commit 02b01e1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/hnswscan.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ GetScanValue(IndexScanDesc scan)
102102
return value;
103103
}
104104

105+
#if defined(HNSW_MEMORY)
106+
/*
107+
* Show memory usage
108+
*/
109+
static void
110+
ShowMemoryUsage(HnswScanOpaque so)
111+
{
112+
elog(INFO, "memory: %zu KB, tuples: " INT64_FORMAT, MemoryContextMemAllocated(so->tmpCtx, false) / 1024, so->tuples);
113+
}
114+
#endif
115+
105116
/*
106117
* Prepare for an index scan
107118
*/
@@ -209,7 +220,7 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
209220
so->first = false;
210221

211222
#if defined(HNSW_MEMORY)
212-
elog(INFO, "memory: %zu KB", MemoryContextMemAllocated(so->tmpCtx, false) / 1024);
223+
ShowMemoryUsage(so);
213224
#endif
214225
}
215226

@@ -271,7 +282,7 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
271282
UnlockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
272283

273284
#if defined(HNSW_MEMORY)
274-
elog(INFO, "memory: %zu KB", MemoryContextMemAllocated(so->tmpCtx, false) / 1024);
285+
ShowMemoryUsage(so);
275286
#endif
276287
}
277288

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy