mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 23:56:55 +08:00
Moved code [skip ci]
This commit is contained in:
@@ -128,6 +128,9 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
|
|||||||
so = (HnswScanOpaque) palloc(sizeof(HnswScanOpaqueData));
|
so = (HnswScanOpaque) palloc(sizeof(HnswScanOpaqueData));
|
||||||
so->typeInfo = HnswGetTypeInfo(index);
|
so->typeInfo = HnswGetTypeInfo(index);
|
||||||
|
|
||||||
|
/* Set support functions */
|
||||||
|
HnswInitSupport(&so->support, index);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use a lower max allocation size than default to allow scanning more
|
* Use a lower max allocation size than default to allow scanning more
|
||||||
* tuples for iterative search before exceeding work_mem
|
* tuples for iterative search before exceeding work_mem
|
||||||
@@ -136,9 +139,6 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
|
|||||||
"Hnsw scan temporary context",
|
"Hnsw scan temporary context",
|
||||||
0, 8 * 1024, 512 * 1024);
|
0, 8 * 1024, 512 * 1024);
|
||||||
|
|
||||||
/* Set support functions */
|
|
||||||
HnswInitSupport(&so->support, index);
|
|
||||||
|
|
||||||
/* Calculate max memory */
|
/* Calculate max memory */
|
||||||
maxMemory = (double) work_mem * hnsw_scan_mem_multiplier * 1024.0;
|
maxMemory = (double) work_mem * hnsw_scan_mem_multiplier * 1024.0;
|
||||||
so->maxMemory = Min(maxMemory, (double) SIZE_MAX);
|
so->maxMemory = Min(maxMemory, (double) SIZE_MAX);
|
||||||
|
|||||||
Reference in New Issue
Block a user