Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit00492d7

Browse files
committed
Ensure max memory fits into Size for HNSW index scans
1 parent857d716 commit00492d7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/hnswscan.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
121121
{
122122
IndexScanDescscan;
123123
HnswScanOpaqueso;
124+
doublemaxMemory;
124125

125126
scan=RelationGetIndexScan(index,nkeys,norderbys);
126127

@@ -138,7 +139,9 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
138139
/* Set support functions */
139140
HnswInitSupport(&so->support,index);
140141

141-
so->maxMemory= (Size) (work_mem*1024.0*hnsw_scan_mem_multiplier);
142+
/* Calculate max memory */
143+
maxMemory= (double)work_mem*hnsw_scan_mem_multiplier*1024.0;
144+
so->maxMemory=Min(maxMemory, (double)SIZE_MAX);
142145

143146
scan->opaque=so;
144147

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp