-
Notifications
You must be signed in to change notification settings - Fork 55
Load neighbours with the fss hash except dublicated neighours. #112
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
Changes from all commits
4ffdf24
b096c30
ba9380b
ea8e2ef
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; | ||
|
||
/* | ||
|
@@ -287,6 +288,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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Этот параметр нужен только для тестирования или зачем? Стоит откомментировать его , иначе непонятна необходимость. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Параметр нужен для того, чтобы не считались предсказания, если найдено меньшее количество соседей, чем задано в параметре min_neighbors_for_predicting. Без этой настройки, aqo сразу делает предсказание при одном найденном соседе, что может быть в некоторых случаях неверно. |
||
"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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Должно быть задано значение по-умолчанию, которое совпадает с умолчальным в точке объявления GUC'a - иначе тесты мастера не пройдет.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, значение по умолчанию берется равным 3.