Moved procinfo initialization for inserts [skip ci]

This commit is contained in:
Andrew Kane
2024-10-09 21:59:21 -07:00
parent 45a6eef9e0
commit 064db12de7
3 changed files with 13 additions and 12 deletions

View File

@@ -679,19 +679,15 @@ UpdateGraphOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, HnswElement
* Insert a tuple into the index
*/
bool
HnswInsertTupleOnDisk(Relation index, Datum value, ItemPointer heaptid, bool building)
HnswInsertTupleOnDisk(Relation index, FmgrInfo *procinfo, Oid collation, Datum value, ItemPointer heaptid, bool building)
{
HnswElement entryPoint;
HnswElement element;
int m;
int efConstruction = HnswGetEfConstruction(index);
FmgrInfo *procinfo;
Oid collation;
LOCKMODE lockmode = ShareLock;
char *base = NULL;
HnswSetProcinfo(index, &procinfo, NULL, &collation);
/*
* Get a shared lock. This allows vacuum to ensure no in-flight inserts
* before repairing graph. Use a page lock so it does not interfere with
@@ -740,14 +736,17 @@ HnswInsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heaptid
{
Datum value;
const HnswTypeInfo *typeInfo = HnswGetTypeInfo(index);
FmgrInfo *normprocinfo = HnswOptionalProcInfo(index, HNSW_NORM_PROC);
Oid collation = index->rd_indcollation[0];
FmgrInfo *procinfo;
FmgrInfo *normprocinfo;
Oid collation;
HnswSetProcinfo(index, &procinfo, &normprocinfo, &collation);
/* Form index value */
if (!HnswFormIndexValue(&value, values, isnull, typeInfo, normprocinfo, collation))
return;
HnswInsertTupleOnDisk(index, value, heaptid, false);
HnswInsertTupleOnDisk(index, procinfo, collation, value, heaptid, false);
}
/*