Skip to content

Commit 8e88b48

Browse files
committed
Use a lower max allocation size than default to allow scanning more tuples for iterative search before exceeding work_mem [skip ci]
1 parent 124018b commit 8e88b48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/hnswscan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
118118
so->first = true;
119119
so->v.tids = NULL;
120120
so->discarded = NULL;
121+
122+
/*
123+
* Use a lower max allocation size than default to allow scanning more
124+
* tuples for iterative search before exceeding work_mem
125+
*/
121126
so->tmpCtx = AllocSetContextCreate(CurrentMemoryContext,
122127
"Hnsw scan temporary context",
123-
ALLOCSET_DEFAULT_SIZES);
128+
0, 8 * 1024, 512 * 1024);
124129

125130
/* Set support functions */
126131
HnswInitSupport(&so->support, index);

0 commit comments

Comments
 (0)