Movatterモバイル変換


[0]ホーム

URL:


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

Commit71d84a9

Browse files
committed
Fixed possible failures on replicas
1 parentfac5663 commit71d84a9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ of per-database.
4343
Note that the extension doesn't work with dynamically generated views. If they
4444
appear in workload, please use`aqo.mode='controlled'`.
4545

46+
The extension doesn't collect statistics on replicas, because replicas are
47+
read-only. It may use query execution statistics from master, nevertheless.
48+
4649
This extension has intelligent self-tuning mode. If you want to rely completely
4750
on it, just add line`aqo.mode = 'intelligent'` into your postgresql.conf.
4851

‎preprocessing.c‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,21 @@ aqo_planner(Query *parse,
174174
aqo_mode);
175175
break;
176176
}
177+
if (RecoveryInProgress())
178+
{
179+
if (aqo_mode==AQO_MODE_FORCED)
180+
{
181+
adding_query= false;
182+
learn_aqo= false;
183+
auto_tuning= false;
184+
collect_stat= false;
185+
}
186+
else
187+
{
188+
disable_aqo_for_query();
189+
returncall_default_planner(parse,cursorOptions,boundParams);
190+
}
191+
}
177192
if (adding_query)
178193
{
179194
add_query(query_hash,learn_aqo,use_aqo,fspace_hash,auto_tuning);
@@ -190,6 +205,12 @@ aqo_planner(Query *parse,
190205
collect_stat=auto_tuning;
191206
if (!learn_aqo&& !use_aqo&& !auto_tuning)
192207
add_deactivated_query(query_hash);
208+
if (RecoveryInProgress())
209+
{
210+
learn_aqo= false;
211+
auto_tuning= false;
212+
collect_stat= false;
213+
}
193214
}
194215
explain_aqo=use_aqo;
195216

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp