pgvector.git / summary / log / commit / refs
commit 3ff2e34d7f1e5e27a6c7e6d99989186ac3d5e598
Author: Andrew Kane <andrew@ankane.org>
Date: Fri Aug 11 03:57:50 2023 +0000
Updated min M to 2 [skip ci]
src/hnsw.h | 2 +-
test/expected/hnsw_options.out | 8 ++++----
test/sql/hnsw_options.sql | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/hnsw.h b/src/hnsw.h
index 0bc9c791..53cc889f 100644
--- a/src/hnsw.h
+++ b/src/hnsw.h
@@ -29,7 +29,7 @@
#define HNSW_HEAD_BLKNO 1 /* first element page */
#define HNSW_DEFAULT_M 16
-#define HNSW_MIN_M 4
+#define HNSW_MIN_M 2
#define HNSW_MAX_M 100
#define HNSW_DEFAULT_EF_CONSTRUCTION 40
#define HNSW_MIN_EF_CONSTRUCTION 10
diff --git a/test/expected/hnsw_options.out b/test/expected/hnsw_options.out
index afdc67aa..5935110c 100644
--- a/test/expected/hnsw_options.out
+++ b/test/expected/hnsw_options.out
@@ -1,11 +1,11 @@
SET enable_seqscan = off;
CREATE TABLE t (val vector(3));
-CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 3);
-ERROR: value 3 out of bounds for option "m"
-DETAIL: Valid values are between "4" and "100".
+CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 1);
+ERROR: value 1 out of bounds for option "m"
+DETAIL: Valid values are between "2" and "100".
CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 101);
ERROR: value 101 out of bounds for option "m"
-DETAIL: Valid values are between "4" and "100".
+DETAIL: Valid values are between "2" and "100".
CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (ef_construction = 9);
ERROR: value 9 out of bounds for option "ef_construction"
DETAIL: Valid values are between "10" and "1000".
diff --git a/test/sql/hnsw_options.sql b/test/sql/hnsw_options.sql
index f70bb956..1e4ca54e 100644
--- a/test/sql/hnsw_options.sql
+++ b/test/sql/hnsw_options.sql
@@ -1,7 +1,7 @@
SET enable_seqscan = off;
CREATE TABLE t (val vector(3));
-CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 3);
+CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 1);
CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (m = 101);
CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (ef_construction = 9);
CREATE INDEX ON t USING hnsw (val vector_l2_ops) WITH (ef_construction = 1001);
[parent: 94a684c9e9d8]