We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentbfb3a45 commit2452270Copy full SHA for 2452270
src/hnswscan.c
@@ -126,9 +126,6 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
126
127
so= (HnswScanOpaque)palloc(sizeof(HnswScanOpaqueData));
128
so->typeInfo=HnswGetTypeInfo(index);
129
-so->first= true;
130
-so->v.tids=NULL;
131
-so->discarded=NULL;
132
133
/*
134
* Use a lower max allocation size than default to allow scanning more
@@ -154,13 +151,10 @@ hnswrescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int no
154
151
{
155
152
HnswScanOpaqueso= (HnswScanOpaque)scan->opaque;
156
153
157
-if (so->v.tids!=NULL)
158
-tidhash_reset(so->v.tids);
159
-
160
-if (so->discarded!=NULL)
161
-pairingheap_reset(so->discarded);
162
163
so->first= true;
+/* v and discarded are allocated in tmpCtx */
+so->v.tids=NULL;
+so->discarded=NULL;
164
so->tuples=0;
165
so->previousDistance=-get_float8_infinity();
166
MemoryContextReset(so->tmpCtx);