-
Notifications
You must be signed in to change notification settings - Fork 55
Add smart statement timeout for learning AQO. #109
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.
aqo--1.3--1.4.sql
Outdated
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? Что подумают люди, у которых уже установлена версия 1.4 ?
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.
Согласна, убрала.
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.
Здесь то же замечание, что и выше. Мы вроде работаем с версией 1.6
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--1.5--1.6.sql.
aqo--1.3--1.4.sql
Outdated
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.
Если хочется как-то защитить бинарники библиотеки от использования не с той версией системного каталога БД, то можно проверять версии, и если они не совпадают, генерировать WARNING,или что-то вроде того. Но сейчас я бы обошелся без такой защиты.
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.
Немного не поняла идею, как тут встроить проверку и вывести ошибку. Есть ли пример похожей реализации?
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.
А почему эти два параметра разного типа? В чём смысл?
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.
Имеют разный смысл. Описала ниже подробней
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.
А не являются ли два гука избыточными?
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_statement_timeout устанавливает предел времени выполнения запроса для того, чтобы успеть сохранить данные обучения в таблицу знаний.
aqo_learn_statement_timeout - немного другая на мой взгляд функциональность, так как она включает возможность увеличивать statement_timeout для каждого отдельного запроса, либо пока aqo не прекратит ошибаться, либо пока не достигнем установленного лимита (aqo_statement_timeout или ванильный statement_timeout)
a8212e9
to
f742330
Compare
...in through manual retraining. AQO evaluates whether enough to execute the query through comparison integral error value with its fixed value (0.1), also if integral error didn't change compared to previous iterations, smart statemet timeout value will be increased. Besides, smart statemet timeout value won't be increased, if there is reached limit value, namely statement timeout. The initial smart_statement_timeout value is aqo statement timeout value or 0. Smart statement timeout value and number of its using are saved in aqo_queries.
f742330
to
090d4b6
Compare
AQO evaluates to have an enough time for training by the average integral error. If the integral error hasn't changed for comparing with error from the previous iteration, we increase the training time exponentially.
Start value of smart statement timeout as equal as aqo_statement timeout or 0. If the user needs an upper limit on query execution time, he can set a vanilla statement timeout setting aqo_statement_timeout as 0. Smart statement timeout in this option is unenabled. The aqo.statement_timeout value is stored in aqo_queries. Initially it equals as 0 (default value). The user has the ability to specify the GUC aqo.statement_timeout and terminates the request by analogy with statement timeout.