Added separate dimensions limit for ivfflat indexes

This commit is contained in:
Andrew Kane
2023-01-10 01:20:25 -08:00
parent 66108cb406
commit b1237c7c4e
2 changed files with 5 additions and 0 deletions

View File

@@ -338,6 +338,9 @@ InitBuildState(IvfflatBuildState * buildstate, Relation heap, Relation index, In
if (buildstate->dimensions < 0)
elog(ERROR, "column does not have dimensions");
if (buildstate->dimensions > IVFFLAT_MAX_DIM)
elog(ERROR, "ivfflat index cannot have more than %d dimensions", IVFFLAT_MAX_DIM);
buildstate->reltuples = 0;
buildstate->indtuples = 0;

View File

@@ -23,6 +23,8 @@
#include "portability/instr_time.h"
#endif
#define IVFFLAT_MAX_DIM VECTOR_MAX_DIM
/* Support functions */
#define IVFFLAT_DISTANCE_PROC 1
#define IVFFLAT_NORM_PROC 2