From af7d9b74a993ad957a54978cfef8f1ca6de4fbe1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 11 Apr 2024 21:07:45 -0700 Subject: [PATCH] Fixed max dimensions for halfvec for IVFFlat [skip ci] --- src/ivfbuild.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ivfbuild.c b/src/ivfbuild.c index 346f03e..f9533f1 100644 --- a/src/ivfbuild.c +++ b/src/ivfbuild.c @@ -320,7 +320,12 @@ InsertTuples(Relation index, IvfflatBuildState * buildstate, ForkNumber forkNum) static int GetMaxDimensions(IvfflatType type) { - return IVFFLAT_MAX_DIM; + int maxDimensions = IVFFLAT_MAX_DIM; + + if (type == IVFFLAT_TYPE_HALFVEC) + maxDimensions *= 2; + + return maxDimensions; } /*