@@ -83,7 +83,7 @@ DROP EXTENSION aqo;
83
83
<listitem>
84
84
<para>
85
85
<literal>forced</literal> —
86
- this mode tries to optimize all queries together, regardless of
86
+ this mode tries to optimize allnew queries together, regardless of
87
87
the query type.
88
88
</para>
89
89
</listitem>
@@ -148,11 +148,8 @@ where <replaceable>mode</> is the name of the optimization mode to use.
148
148
mode. However, since the <literal>forced</literal> mode lacks
149
149
intelligent tuning, performance may decrease for some queries.
150
150
If you see performance issues in this mode, switch <filename>aqo</filename> to the
151
- <literal>controlled</literal> mode:
151
+ <literal>controlled</literal> mode.
152
152
</para>
153
- <programlisting>
154
- SET aqo.mode = 'controlled';
155
- </programlisting>
156
153
<para>
157
154
In the <literal>controlled</literal> mode, <filename>aqo</filename> does not collect statistics for new
158
155
query types, so they will not be optimized. For known query
@@ -298,6 +295,57 @@ UPDATE aqo_queries SET learn_aqo=false WHERE query_hash = '<replaceable>hash</>'
298
295
UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;
299
296
</programlisting>
300
297
</sect3>
298
+ <sect3 id="using-aqo-on-standby">
299
+ <title>Using aqo on Standby</title>
300
+ <para>
301
+ In master-standby configurations, <filename>aqo</filename>
302
+ statistics on standby is inherited from master in read-only mode.
303
+ Standby queries do not update <filename>aqo</filename> statistics,
304
+ regardless of the current <filename>aqo</filename> settings.
305
+ If you would like to update the statistics on
306
+ standby for one or more query types, you must run these queries
307
+ on master and synchronize the standby.
308
+ </para>
309
+ <para>
310
+ You can define whether to use <filename>aqo</filename> statistics
311
+ for standby queries independent of the master configuration,
312
+ toggling <filename>aqo</filename> modes as required. By default,
313
+ <filename>aqo</filename> optimizes queries on standby as follows:
314
+ <itemizedlist>
315
+ <listitem>
316
+ <para>
317
+ In <literal>intelligent</> and <literal>controlled</> modes,
318
+ <filename>aqo</filename> statistics is only used for the
319
+ alreadyknown query types.
320
+ </para>
321
+ </listitem>
322
+ <listitem>
323
+ <para>
324
+ In the <literal>forced</> mode,
325
+ <filename>aqo</filename> tries to optimize the unknown
326
+ queries based on the common statistics collected in the
327
+ <literal>forced</> mode on master, if any. If the common
328
+ statistics is not found, <filename>aqo</filename> falls back
329
+ to the default query planner. All the known query types continue using
330
+ the available statistics.
331
+ </para>
332
+ </listitem>
333
+ <listitem>
334
+ <para>
335
+ The <literal>disabled</literal> mode switches off the collected
336
+ statistics completely, relying on the default query planner
337
+ for all queries.
338
+ </para>
339
+ </listitem>
340
+ </itemizedlist>
341
+ </para>
342
+ <para>
343
+ If you fine-tuned optimization settings for specific query types
344
+ on master, these settings override the default <filename>aqo</filename>
345
+ behavior, unless you choose the <literal>disabled</literal> mode.
346
+ For details, see <xref linkend="aqo-advanced-query-tuning">.
347
+ </para>
348
+ </sect3>
301
349
</sect2>
302
350
<sect2 id="aqo-reference">
303
351
<title>Reference</title>