Moved code [skip ci]

This commit is contained in:
Andrew Kane
2024-10-27 22:21:43 -07:00
parent 6a30c1e824
commit b163b5b196

View File

@@ -128,6 +128,9 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
so = (HnswScanOpaque) palloc(sizeof(HnswScanOpaqueData));
so->typeInfo = HnswGetTypeInfo(index);
/* Set support functions */
HnswInitSupport(&so->support, index);
/*
* Use a lower max allocation size than default to allow scanning more
* tuples for iterative search before exceeding work_mem
@@ -136,9 +139,6 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
"Hnsw scan temporary context",
0, 8 * 1024, 512 * 1024);
/* Set support functions */
HnswInitSupport(&so->support, index);
/* Calculate max memory */
maxMemory = (double) work_mem * hnsw_scan_mem_multiplier * 1024.0;
so->maxMemory = Min(maxMemory, (double) SIZE_MAX);