pgvector.git / summary / log / commit / refs

commit    af7d9b74a993ad957a54978cfef8f1ca6de4fbe1
Author:   Andrew Kane <andrew@ankane.org>
Date:     Fri Apr 12 04:07:45 2024 +0000

    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 346f03ee..f9533f1a 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; } /* [parent: f1a71524f00c]