pgvector.git / summary / log / commit / refs
commit 86c29b3bf038de50bb2aec21b6d896823ff1fbbe
Author: Andrew Kane <andrew@ankane.org>
Date: Thu Aug 24 04:10:00 2023 +0000
Improved param code
src/ivfflat.c | 4 ++--
src/ivfflat.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/ivfflat.c b/src/ivfflat.c
index 3753a74d..5057adc2 100644
--- a/src/ivfflat.c
+++ b/src/ivfflat.c
@@ -24,7 +24,7 @@ IvfflatInit(void)
{
ivfflat_relopt_kind = add_reloption_kind();
add_int_reloption(ivfflat_relopt_kind, "lists", "Number of inverted lists",
- IVFFLAT_DEFAULT_LISTS, 1, IVFFLAT_MAX_LISTS
+ IVFFLAT_DEFAULT_LISTS, IVFFLAT_MIN_LISTS, IVFFLAT_MAX_LISTS
#if PG_VERSION_NUM >= 130000
,AccessExclusiveLock
#endif
@@ -32,7 +32,7 @@ IvfflatInit(void)
DefineCustomIntVariable("ivfflat.probes", "Sets the number of probes",
"Valid range is 1..lists.", &ivfflat_probes,
- 1, 1, IVFFLAT_MAX_LISTS, PGC_USERSET, 0, NULL, NULL, NULL);
+ IVFFLAT_DEFAULT_PROBES, IVFFLAT_MIN_LISTS, IVFFLAT_MAX_LISTS, PGC_USERSET, 0, NULL, NULL, NULL);
}
/*
diff --git a/src/ivfflat.h b/src/ivfflat.h
index c68cfcd2..4e701e2f 100644
--- a/src/ivfflat.h
+++ b/src/ivfflat.h
@@ -42,7 +42,9 @@
/* IVFFlat parameters */
#define IVFFLAT_DEFAULT_LISTS 100
+#define IVFFLAT_MIN_LISTS 1
#define IVFFLAT_MAX_LISTS 32768
+#define IVFFLAT_DEFAULT_PROBES 1
/* Build phases */
/* PROGRESS_CREATEIDX_SUBPHASE_INITIALIZE is 1 */
[parent: e406b7f5ea03]