Updated default value of hnsw.scan_mem_multiplier [skip ci]

This commit is contained in:
Andrew Kane
2024-10-27 21:05:04 -07:00
parent 38f42820be
commit f9d627c9a9
3 changed files with 5 additions and 5 deletions

View File

@@ -505,10 +505,10 @@ SET hnsw.max_scan_tuples = 20000;
Note: This is approximate and does not apply to the initial scan
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)
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)
```sql
SET hnsw.scan_mem_multiplier = 4;
SET hnsw.scan_mem_multiplier = 2;
```
You can see when this is needed by enabling debug messages
@@ -520,7 +520,7 @@ SET client_min_messages = debug1;
which will show when a scan reaches the memory limit
```text
DEBUG: hnsw index scan reached memory limit after 40000 tuples
DEBUG: hnsw index scan reached memory limit after 20000 tuples
HINT: Increase hnsw.scan_mem_multiplier to scan more tuples.
```

View File

@@ -91,7 +91,7 @@ HnswInit(void)
/* Same range and default as hash_mem_multiplier */
DefineCustomRealVariable("hnsw.scan_mem_multiplier", "Sets the multiple of work_mem to use for iterative scans",
NULL, &hnsw_scan_mem_multiplier,
2, 1, 1000, PGC_USERSET, 0, NULL, NULL, NULL);
1, 1, 1000, PGC_USERSET, 0, NULL, NULL, NULL);
MarkGUCPrefixReserved("hnsw");
}

View File

@@ -185,7 +185,7 @@ ERROR: 0 is outside the valid range for parameter "hnsw.max_scan_tuples" (1 ..
SHOW hnsw.scan_mem_multiplier;
hnsw.scan_mem_multiplier
--------------------------
2
1
(1 row)
SET hnsw.scan_mem_multiplier = 0;