-
Notifications
You must be signed in to change notification settings - Fork 54
Bugfix. Switch off quickly all AQO features if queryId is disabled. #142
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
Conversation
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.
Вопросы только по объявленным, но неиспользуемым хукам в cardinality_hooks.c
aqo.c
Outdated
/* Saved hooks */ | ||
static planner_hook_type prev_planner_hook = NULL; | ||
static ExecutorStart_hook_type prev_ExecutorStart_hook = NULL; | ||
static ExecutorRun_hook_type prev_ExecutorRun = NULL; |
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.
Остальные хуки именуются *_hook, а prev_ExecutorRun отличается от остальных.
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.
Done
cardinality_hooks.c
Outdated
set_baserel_rows_estimate_hook_type prev_set_baserel_rows_estimate_hook = NULL; | ||
get_parameterized_baserel_size_hook_type prev_get_parameterized_baserel_size_hook = NULL; | ||
set_joinrel_size_estimates_hook_type prev_set_joinrel_size_estimates_hook = NULL; | ||
get_parameterized_joinrel_size_hook_type prev_get_parameterized_joinrel_size_hook = NULL; |
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.
Эти переменные используются только в aqo.c, но там они переобъявлены.
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.
Done
cardinality_hooks.c
Outdated
@@ -33,103 +33,16 @@ | |||
#include "machine_learning.h" | |||
#include "path_utils.h" | |||
|
|||
estimate_num_groups_hook_type prev_estimate_num_groups_hook = NULL; | |||
estimate_num_groups_hook_type prev_estimate_num_groups_hook = NULL; |
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.
prev_estimate_num_groups_hook используется в функции aqo_estimate_num_groups_hook() для проверки, что нет посторонних хуков.
Наверное, проверку можно вынести в PG_init()
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.
Не согласен. Кто-то может позже переопределить хук. Добавил более строгую проверку
2dc14d9
to
cacc8c2
Compare
different libraries. To avoid such a problem in future, refactor AQO interfaces: declare all hooks as static, reduce number of exporting functions and introduce concept of *_init() function for a module that needs some actions in the PG_init() routine. Reviewed by: @Anisimov-ds
One installcheck test was added into the github actions workflow. Reviewed by: @Anisimov-ds
cacc8c2
to
700ed29
Compare
…n of AQO prediction hooks. It isn't a strict rule, but we should know about that.
One installcheck test was added into the github actions workflow.
Push it into stable14 and master as quick as possible.
stable13 based on custom query hash and don't needed this.
Remember! The master branch can contain one more hook! Check it.