1
0
mirror of https://github.com/pgvector/pgvector.git synced 2026-10-23 10:48:54 +03:00

Limit maxPrefetch [skip ci]

This commit is contained in:
Andrew Kane
2026-10-18 04:56:42 -07:00
parent 073744b5b5
commit cb331caf1f

View File

@@ -899,10 +899,15 @@ HnswInitSearchState(HnswSearchState * searchState, Relation index, bool maintena
#elif defined(HNSW_USE_PREFETCH)
if (!inMemory)
{
int maxM = HnswGetLayerM(HNSW_MAX_M, 0);
int ioConcurrency;
if (maintenance)
searchState->maxPrefetch = get_tablespace_maintenance_io_concurrency(index->rd_rel->reltablespace);
ioConcurrency = get_tablespace_maintenance_io_concurrency(index->rd_rel->reltablespace);
else
searchState->maxPrefetch = get_tablespace_io_concurrency(index->rd_rel->reltablespace);
ioConcurrency = get_tablespace_io_concurrency(index->rd_rel->reltablespace);
searchState->maxPrefetch = Min(maxM, ioConcurrency);
}
#endif
}