mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 15:16:54 +08:00
Improved hnswrescan
This commit is contained in:
@@ -126,9 +126,6 @@ hnswbeginscan(Relation index, int nkeys, int norderbys)
|
|||||||
|
|
||||||
so = (HnswScanOpaque) palloc(sizeof(HnswScanOpaqueData));
|
so = (HnswScanOpaque) palloc(sizeof(HnswScanOpaqueData));
|
||||||
so->typeInfo = HnswGetTypeInfo(index);
|
so->typeInfo = HnswGetTypeInfo(index);
|
||||||
so->first = true;
|
|
||||||
so->v.tids = NULL;
|
|
||||||
so->discarded = NULL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use a lower max allocation size than default to allow scanning more
|
* 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
|
|||||||
{
|
{
|
||||||
HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
|
HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
|
||||||
|
|
||||||
if (so->v.tids != NULL)
|
|
||||||
tidhash_reset(so->v.tids);
|
|
||||||
|
|
||||||
if (so->discarded != NULL)
|
|
||||||
pairingheap_reset(so->discarded);
|
|
||||||
|
|
||||||
so->first = true;
|
so->first = true;
|
||||||
|
/* v and discarded are allocated in tmpCtx */
|
||||||
|
so->v.tids = NULL;
|
||||||
|
so->discarded = NULL;
|
||||||
so->tuples = 0;
|
so->tuples = 0;
|
||||||
so->previousDistance = -get_float8_infinity();
|
so->previousDistance = -get_float8_infinity();
|
||||||
MemoryContextReset(so->tmpCtx);
|
MemoryContextReset(so->tmpCtx);
|
||||||
|
|||||||
Reference in New Issue
Block a user