Removed normvec from IVFFlat for simplicity (no difference in performance)

This commit is contained in:
Andrew Kane
2024-03-27 16:41:17 -07:00
parent 8e59455c3c
commit ba18942fcf
5 changed files with 7 additions and 14 deletions

View File

@@ -75,16 +75,14 @@ IvfflatOptionalProcInfo(Relation index, uint16 procnum)
* if it's different than the original value
*/
bool
IvfflatNormValue(FmgrInfo *procinfo, Oid collation, Datum *value, Vector * result)
IvfflatNormValue(FmgrInfo *procinfo, Oid collation, Datum *value)
{
double norm = DatumGetFloat8(FunctionCall1Coll(procinfo, collation, *value));
if (norm > 0)
{
Vector *v = DatumGetVector(*value);
if (result == NULL)
result = InitVector(v->dim);
Vector *result = InitVector(v->dim);
for (int i = 0; i < v->dim; i++)
result->x[i] = v->x[i] / norm;