Reduced memory and allocations for heap TIDs - closes #385

This commit is contained in:
Andrew Kane
2024-01-03 13:41:34 -05:00
parent cae630784b
commit 9b73b3d1a6
5 changed files with 16 additions and 21 deletions

View File

@@ -188,15 +188,13 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
ItemPointer heaptid;
/* Move to next element if no valid heap TIDs */
if (list_length(hc->element->heaptids) == 0)
if (hc->element->heaptidsLength == 0)
{
so->w = list_delete_last(so->w);
continue;
}
heaptid = llast(hc->element->heaptids);
hc->element->heaptids = list_delete_last(hc->element->heaptids);
heaptid = &hc->element->heaptids[--hc->element->heaptidsLength];
MemoryContextSwitchTo(oldCtx);