mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-16 01:26:56 +08:00
Improved readability [skip ci]
This commit is contained in:
@@ -263,13 +263,13 @@ CreateNeighborPages(HnswBuildState * buildstate)
|
|||||||
pfree(ntup);
|
pfree(ntup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HNSW_MEMORY
|
||||||
/*
|
/*
|
||||||
* Show memory usage
|
* Show memory usage
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ShowMemoryUsage(HnswBuildState * buildstate)
|
ShowMemoryUsage(HnswBuildState * buildstate)
|
||||||
{
|
{
|
||||||
#ifdef HNSW_MEMORY
|
|
||||||
#if PG_VERSION_NUM >= 130000
|
#if PG_VERSION_NUM >= 130000
|
||||||
elog(INFO, "graph memory: %zu MB, total memory: %zu MB",
|
elog(INFO, "graph memory: %zu MB, total memory: %zu MB",
|
||||||
MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024),
|
MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024),
|
||||||
@@ -278,8 +278,8 @@ ShowMemoryUsage(HnswBuildState * buildstate)
|
|||||||
MemoryContextStats(CurrentMemoryContext);
|
MemoryContextStats(CurrentMemoryContext);
|
||||||
elog(INFO, "estimated memory: %zu MB", buildstate->memoryUsed / (1024 * 1024));
|
elog(INFO, "estimated memory: %zu MB", buildstate->memoryUsed / (1024 * 1024));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flush pages
|
* Flush pages
|
||||||
@@ -287,7 +287,9 @@ ShowMemoryUsage(HnswBuildState * buildstate)
|
|||||||
static void
|
static void
|
||||||
FlushPages(HnswBuildState * buildstate)
|
FlushPages(HnswBuildState * buildstate)
|
||||||
{
|
{
|
||||||
|
#ifdef HNSW_MEMORY
|
||||||
ShowMemoryUsage(buildstate);
|
ShowMemoryUsage(buildstate);
|
||||||
|
#endif
|
||||||
|
|
||||||
CreateMetaPage(buildstate);
|
CreateMetaPage(buildstate);
|
||||||
CreateElementPages(buildstate);
|
CreateElementPages(buildstate);
|
||||||
|
|||||||
Reference in New Issue
Block a user