Skip to content

Commit 7d9168a

Browse files
author
Liudmila Mantrova
committed
Implemented feedback from Victor W. for AQO document
1 parent f5cdd04 commit 7d9168a

File tree

1 file changed

+99
-75
lines changed

1 file changed

+99
-75
lines changed

doc/src/sgml/aqo.sgml

Lines changed: 99 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@
5252
<filename>postgresql.conf</filename> file:
5353
</para>
5454
<programlisting>
55-
shared_preload_libraries = 'aqo.so'
55+
shared_preload_libraries = 'aqo'
5656
</programlisting>
5757
<para>
58-
You must preload the <filename>aqo.so</filename> library at the server startup,
59-
since adaptive query optimization needs to be enabled per
60-
database.
58+
You should preload the `aqo` library at the server startup, since
59+
adaptive query optimization needs to be enabled per database, not per connection. Otherwise, all the collected statistics will be lost when the session ends.
6160
</para>
6261
</listitem>
6362
<listitem>
@@ -314,39 +313,44 @@ DELETE FROM aqo_data WHERE fspace_hash = (SELECT fspace_hash FROM aqo_queries
314313
query planner, run:
315314
</para>
316315
<programlisting>
317-
UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;s
316+
UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;
318317
</programlisting>
319318
</sect3>
320319
</sect2>
321320
<sect2 id="aqo-reference">
322321
<title>Reference</title>
323322
<sect3 id="aqo-variables">
324323
<title>Configuration Variables</title>
325-
<para>The aqo extension provides the following configuration variables:
326-
</para>
327324
<sect4 id="aqo-mode">
328325
<title>aqo.mode</title>
329326
<para>Defines the <filename>aqo</filename> optimization modes.
330327
</para>
331-
<para><emphasis role="strong">Options:</emphasis>
332-
</para>
333-
<itemizedlist spacing="compact">
334-
<listitem>
335-
<para>
336-
<literal>intelligent</literal> - auto-tunes your queries based on statistics collected per query type.
337-
</para>
338-
</listitem>
339-
<listitem>
340-
<para>
341-
<literal>forced</literal> - optimizes all queries together, regardless of the query type.
342-
</para>
343-
</listitem>
344-
<listitem>
345-
<para>
346-
<literal>manual</literal> (default) - uses the default planner for all new queries, but can reuse the collected statistics for already known query types, if any.
347-
</para>
348-
</listitem>
349-
</itemizedlist>
328+
329+
<table id="aqo-mode-options">
330+
<title>aqo.mode Options</title>
331+
<tgroup cols="2">
332+
<thead>
333+
<row><entry>Option</entry> <entry>Description</entry>
334+
</row>
335+
</thead>
336+
337+
<tbody>
338+
<row>
339+
<entry><literal>intelligent</literal></entry>
340+
<entry>Auto-tunes your queries based on statistics collected per query type.</entry>
341+
342+
</row>
343+
<row>
344+
<entry><literal>forced</literal></entry>
345+
<entry>Optimizes all queries together, regardless of the query type.</entry>
346+
</row>
347+
<row>
348+
<entry><literal>manual</literal></entry>
349+
<entry><emphasis role="strong">Default.</emphasis> Uses the default planner for all new queries, but can reuse the collected statistics for already known query types, if any.</entry>
350+
</row>
351+
</tbody>
352+
</tgroup>
353+
</table>
350354
</sect4>
351355

352356

@@ -357,54 +361,67 @@ UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;s
357361
<title>aqo_query_texts Table</title>
358362
<para>
359363
The <literal>aqo_query_texts</literal> table classifies all
360-
the query types processed by <filename>aqo</filename>. This
361-
table includes the following columns:
364+
the query types processed by <filename>aqo</filename>.
362365
</para>
363-
<itemizedlist spacing="compact">
364-
<listitem>
365-
<para>
366-
<literal>query_hash</literal> stores the hash value that
367-
uniquely identifies the query type.
368-
</para>
369-
</listitem>
370-
<listitem>
371-
<para>
372-
<literal>query_text</literal> provides a sample query of
373-
the given type.
374-
</para>
375-
</listitem>
376-
</itemizedlist>
366+
<table id="aqo-query-texts-ref">
367+
<title>aqo_query_texts Table</title>
368+
<tgroup cols="2">
369+
<thead>
370+
<row><entry>Column Name</entry> <entry>Description</entry>
371+
</row>
372+
</thead>
373+
374+
<tbody>
375+
<row>
376+
<entry><literal>query_hash</literal></entry>
377+
<entry>Stores the hash value that uniquely identifies the query type.</entry>
378+
</row>
379+
<row>
380+
<entry><literal>query_text</literal></entry>
381+
<entry>Provides a sample query of
382+
the given type.</entry>
383+
</row>
384+
385+
</tbody>
386+
</tgroup>
387+
</table>
377388
</sect4>
378389
<sect4 id="aqo-queries-table">
379390
<title>aqo_queries Table</title>
380391
<para>
381392
The <literal>aqo_queries</literal> table stores optimization
382-
settings for different query types:
393+
settings for different query types.
383394
</para>
384-
<itemizedlist spacing="compact">
385-
<listitem>
386-
<para>
387-
<literal>query_hash</literal> stores the hash value that
388-
uniquely identifies the query type.
389-
</para>
390-
</listitem>
391-
<listitem>
392-
<para>
393-
<literal>learn_aqo</literal> enables statistics collection
394-
for this query type.
395-
</para>
396-
</listitem>
397-
<listitem>
398-
<para>
399-
<literal>use_aqo</literal> enables AQO cardinality
395+
396+
<table id="aqo-queries-table-ref">
397+
<title>aqo_queries Table</title>
398+
<tgroup cols="2">
399+
<thead>
400+
<row><entry>Setting</entry><entry>Description</entry>
401+
</row>
402+
</thead>
403+
404+
<tbody>
405+
<row>
406+
<entry><literal>query_hash</literal></entry>
407+
<entry>Stores the hash value that uniquely identifies the query type.</entry>
408+
409+
</row>
410+
<row>
411+
<entry><literal>learn_aqo</literal></entry>
412+
<entry>Enables statistics collection
413+
for this query type.</entry>
414+
</row>
415+
<row>
416+
<entry><literal>use_aqo</literal></entry>
417+
<entry>Enables <filename>aqo</filename> cardinality
400418
prediction for the next execution of this query type. If
401419
cost estimation model is incomplete, this may slow down
402-
query execution.
403-
</para>
404-
</listitem>
405-
<listitem>
406-
<para>
407-
<literal>fspace_hash</literal> is a unique identifier of
420+
query execution.</entry>
421+
</row>
422+
<row>
423+
<entry><literal>fspace_hash</literal></entry>
424+
<entry>Provides a unique identifier of
408425
the separate space in which the data for this query type
409426
is collected. By default, <literal>fspace_hash</literal>
410427
is equal to <literal>query_hash</literal>. Using this
@@ -413,21 +430,21 @@ UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;s
413430
amount of memory for models and even improve query
414431
execution performance. However, changing this setting may
415432
cause unexpected <filename>aqo</filename> behavior, so make sure to use it only
416-
if you know what you are doing.
417-
</para>
418-
</listitem>
419-
<listitem>
420-
<para>
421-
<literal>auto_tuning</literal> shows whether
433+
if you know what you are doing.</entry>
434+
</row>
435+
<row>
436+
<entry><literal>auto_tuning</literal></entry>
437+
<entry>Shows whether
422438
<filename>aqo</filename> tries to tune other settings for
423439
the given query. By default, auto-tuning in enabled in the
424440
intelligent mode. In other modes, new queries are not
425441
appended to <literal>aqo_queries</literal> automatically.
426442
You can change this behavior by setting the
427-
<literal>auto_tuning</literal> variable to TRUE.
428-
</para>
429-
</listitem>
430-
</itemizedlist>
443+
<literal>auto_tuning</literal> variable to TRUE.</entry>
444+
</row>
445+
</tbody>
446+
</tgroup>
447+
</table>
431448
</sect4>
432449
<sect4 id="aqo-data-table">
433450
<title>aqo_data Table</title>
@@ -470,4 +487,11 @@ UPDATE aqo_queries SET use_aqo=false, learn_aqo=false, auto_tuning=false;s
470487
</sect4>
471488
</sect3>
472489
</sect2>
490+
<sect2 id="aqo-authors">
491+
<title>Authors</title>
492+
<para>
493+
Oleg Ivanov <email>o.ivanov@postgrespro.ru</email>,
494+
Postgres Professional, Moscow, Russia
495+
</para>
496+
</sect2>
473497
</sect1>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy