Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
danolivo merged 4 commits into stable14 from 14-look-a-like
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion aqo.c
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;

/*
Expand Down Expand Up @@ -293,6 +294,29 @@ _PG_init(void)
NULL
);

DefineCustomIntVariable("aqo.k_neighbors_threshold",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь те же вопросы, что и в #112
Ну и внимательнее смотреть в свои комменты, прогонять через проверку словаря, грамматики, может быть.

Copy link
Collaborator Author

@Alena0704 Alena0704 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Параметр переименовала и добавила более понятные описания в них.
Ответила на вопросы в #112

"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;
Expand Down
1 change: 1 addition & 0 deletions aqo.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ extern double auto_tuning_convergence_error;
/* Machine learning parameters */

extern int aqo_k;
extern bool aqo_predict_with_few_neighbors;
extern double log_selectivity_lower_bound;

/* Parameters for current query */
Expand Down
2 changes: 1 addition & 1 deletion cardinality_estimation.c
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ predict_for_relation(List *clauses, List *selectivities, List *relsigns,
*/

/* Try to search in surrounding feature spaces for the same node */
if (!load_aqo_data(query_context.fspace_hash, *fss, data, NULL, use_wide_search))
if (!load_aqo_data(query_context.fspace_hash, *fss, data, NULL, use_wide_search, features))
result = -1;
else
{
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /