Switched to slist for elements to reduce allocations and remove limit

This commit is contained in:
Andrew Kane
2024-01-07 18:26:19 -08:00
parent 85fdecd79b
commit cb4c770df2
2 changed files with 16 additions and 22 deletions

View File

@@ -6,6 +6,7 @@
#include "access/generic_xlog.h"
#include "access/parallel.h"
#include "access/reloptions.h"
#include "lib/ilist.h"
#include "nodes/execnodes.h"
#include "port.h" /* for random() */
#include "utils/sampling.h"
@@ -103,6 +104,7 @@ typedef struct HnswNeighborArray HnswNeighborArray;
typedef struct HnswElementData
{
slist_node next;
ItemPointerData heaptids[HNSW_HEAPTIDS];
uint8 heaptidsLength;
uint8 level;
@@ -212,7 +214,7 @@ typedef struct HnswBuildState
Oid collation;
/* Variables */
List *elements;
slist_head elements;
HnswElement entryPoint;
double ml;
int maxLevel;