-
Notifications
You must be signed in to change notification settings - Fork 55
14 look a like #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
14 look a like #115
Changes from 3 commits
1aea13f
09f4d12
3c7f20f
4c73906
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ void _PG_init(void); | |
/* Strategy of determining feature space for new queries. */ | ||
int aqo_mode = AQO_MODE_CONTROLLED; | ||
bool force_collect_stat; | ||
bool aqo_predict_with_few_neighbors; | ||
|
||
/* | ||
* Show special info in EXPLAIN mode. | ||
|
@@ -71,7 +72,7 @@ int auto_tuning_infinite_loop = 8; | |
/* Machine learning parameters */ | ||
|
||
/* The number of nearest neighbors which will be chosen for ML-operations */ | ||
int aqo_k = 3; | ||
int aqo_k; | ||
double log_selectivity_lower_bound = -30; | ||
|
||
/* | ||
|
@@ -293,6 +294,29 @@ _PG_init(void) | |
NULL | ||
); | ||
|
||
DefineCustomIntVariable("aqo.k_neighbors_threshold", | ||
|
||
"Set the threshold of number of neighbors for predicting.", | ||
NULL, | ||
&aqo_k, | ||
3, | ||
1, INT_MAX / 1000, | ||
PGC_USERSET, | ||
0, | ||
NULL, | ||
NULL, | ||
NULL); | ||
|
||
DefineCustomBoolVariable("aqo.predict_with_few_neighbors", | ||
"Make prediction with less neighbors than we should have.", | ||
NULL, | ||
&aqo_predict_with_few_neighbors, | ||
true, | ||
PGC_USERSET, | ||
0, | ||
NULL, | ||
NULL, | ||
NULL); | ||
|
||
prev_shmem_startup_hook = shmem_startup_hook; | ||
shmem_startup_hook = aqo_init_shmem; | ||
prev_planner_hook = planner_hook; | ||
|