mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-07 13:10:56 +08:00
Simplified GUC names [skip ci]
This commit is contained in:
10
src/hnsw.c
10
src/hnsw.c
@@ -26,7 +26,7 @@ static const struct config_enum_entry hnsw_iterative_search_options[] = {
|
||||
};
|
||||
|
||||
int hnsw_ef_search;
|
||||
int hnsw_iterative_search_max_tuples;
|
||||
int hnsw_max_search_tuples;
|
||||
int hnsw_iterative_search;
|
||||
int hnsw_lock_tranche_id;
|
||||
static relopt_kind hnsw_relopt_kind;
|
||||
@@ -78,13 +78,13 @@ HnswInit(void)
|
||||
"Valid range is 1..1000.", &hnsw_ef_search,
|
||||
HNSW_DEFAULT_EF_SEARCH, HNSW_MIN_EF_SEARCH, HNSW_MAX_EF_SEARCH, PGC_USERSET, 0, NULL, NULL, NULL);
|
||||
|
||||
DefineCustomEnumVariable("hnsw.iterative_search", "Sets iterative search",
|
||||
DefineCustomEnumVariable("hnsw.iterative_search", "Sets iterative search mode",
|
||||
NULL, &hnsw_iterative_search,
|
||||
HNSW_ITERATIVE_SEARCH_OFF, hnsw_iterative_search_options, PGC_USERSET, 0, NULL, NULL, NULL);
|
||||
|
||||
/* TODO Ensure ivfflat.max_probes uses same value for "all" */
|
||||
DefineCustomIntVariable("hnsw.iterative_search_max_tuples", "Sets the max number of candidates to visit for iterative search",
|
||||
"-1 means all", &hnsw_iterative_search_max_tuples,
|
||||
/* TODO Ensure ivfflat.max_probes uses same value for no limit */
|
||||
DefineCustomIntVariable("hnsw.max_search_tuples", "Sets the max number of candidates to visit for iterative search",
|
||||
"-1 means no limit", &hnsw_max_search_tuples,
|
||||
-1, -1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
|
||||
|
||||
MarkGUCPrefixReserved("hnsw");
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
/* Variables */
|
||||
extern int hnsw_ef_search;
|
||||
extern int hnsw_iterative_search;
|
||||
extern int hnsw_iterative_search_max_tuples;
|
||||
extern int hnsw_max_search_tuples;
|
||||
extern int hnsw_lock_tranche_id;
|
||||
|
||||
typedef enum HnswIterativeSearchType
|
||||
|
||||
@@ -230,7 +230,7 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
|
||||
break;
|
||||
|
||||
/* Reached max number of tuples */
|
||||
if (hnsw_iterative_search_max_tuples != -1 && so->tuples >= hnsw_iterative_search_max_tuples)
|
||||
if (hnsw_max_search_tuples != -1 && so->tuples >= hnsw_max_search_tuples)
|
||||
{
|
||||
if (pairingheap_is_empty(so->discarded))
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
int ivfflat_probes;
|
||||
int ivfflat_iterative_search;
|
||||
int ivfflat_iterative_search_max_probes;
|
||||
int ivfflat_max_probes;
|
||||
static relopt_kind ivfflat_relopt_kind;
|
||||
|
||||
static const struct config_enum_entry ivfflat_iterative_search_options[] = {
|
||||
@@ -45,8 +45,8 @@ IvfflatInit(void)
|
||||
NULL, &ivfflat_iterative_search,
|
||||
IVFFLAT_ITERATIVE_SEARCH_OFF, ivfflat_iterative_search_options, PGC_USERSET, 0, NULL, NULL, NULL);
|
||||
|
||||
DefineCustomIntVariable("ivfflat.iterative_search_max_probes", "Sets the max number of probes for iterative search",
|
||||
"Zero sets to the number of lists", &ivfflat_iterative_search_max_probes,
|
||||
DefineCustomIntVariable("ivfflat.max_probes", "Sets the max number of probes for iterative search",
|
||||
"Zero sets to the number of lists", &ivfflat_max_probes,
|
||||
0, 0, IVFFLAT_MAX_LISTS, PGC_USERSET, 0, NULL, NULL, NULL);
|
||||
|
||||
MarkGUCPrefixReserved("ivfflat");
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
/* Variables */
|
||||
extern int ivfflat_probes;
|
||||
extern int ivfflat_iterative_search;
|
||||
extern int ivfflat_iterative_search_max_probes;
|
||||
extern int ivfflat_max_probes;
|
||||
|
||||
typedef enum IvfflatIterativeSearchType
|
||||
{
|
||||
|
||||
@@ -264,10 +264,10 @@ ivfflatbeginscan(Relation index, int nkeys, int norderbys)
|
||||
|
||||
if (ivfflat_iterative_search != IVFFLAT_ITERATIVE_SEARCH_OFF)
|
||||
{
|
||||
if (ivfflat_iterative_search_max_probes == 0)
|
||||
if (ivfflat_max_probes == 0)
|
||||
maxProbes = lists;
|
||||
else
|
||||
maxProbes = Min(ivfflat_iterative_search_max_probes, lists);
|
||||
maxProbes = Min(ivfflat_max_probes, lists);
|
||||
}
|
||||
else
|
||||
maxProbes = probes;
|
||||
|
||||
Reference in New Issue
Block a user