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

Commitf9d627c

Browse files
committed
Updated default value of hnsw.scan_mem_multiplier [skip ci]
1 parent38f4282 commitf9d627c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ SET hnsw.max_scan_tuples = 20000;
505505

506506
Note: This is approximate and does not apply to the initial scan
507507

508-
When increasing this, you may also need to increase the max amount of memory an iterative scan can use, which is a multiple of`work_mem` (2 by default)
508+
When increasing this, you may also need to increase the max amount of memory an iterative scan can use, which is a multiple of`work_mem` (1 by default)
509509

510510
```sql
511-
SEThnsw.scan_mem_multiplier=4;
511+
SEThnsw.scan_mem_multiplier=2;
512512
```
513513

514514
You can see when this is needed by enabling debug messages
@@ -520,7 +520,7 @@ SET client_min_messages = debug1;
520520
which will show when a scan reaches the memory limit
521521

522522
```text
523-
DEBUG: hnsw index scan reached memory limit after40000 tuples
523+
DEBUG: hnsw index scan reached memory limit after20000 tuples
524524
HINT: Increase hnsw.scan_mem_multiplier to scan more tuples.
525525
```
526526

‎src/hnsw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ HnswInit(void)
9191
/* Same range and default as hash_mem_multiplier */
9292
DefineCustomRealVariable("hnsw.scan_mem_multiplier","Sets the multiple of work_mem to use for iterative scans",
9393
NULL,&hnsw_scan_mem_multiplier,
94-
2,1,1000,PGC_USERSET,0,NULL,NULL,NULL);
94+
1,1,1000,PGC_USERSET,0,NULL,NULL,NULL);
9595

9696
MarkGUCPrefixReserved("hnsw");
9797
}

‎test/expected/hnsw_vector.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ERROR: 0 is outside the valid range for parameter "hnsw.max_scan_tuples" (1 ..
185185
SHOW hnsw.scan_mem_multiplier;
186186
hnsw.scan_mem_multiplier
187187
--------------------------
188-
2
188+
1
189189
(1 row)
190190

191191
SET hnsw.scan_mem_multiplier = 0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp