Remove the old advice to keep from_collapse_limit less than geqo_threshold,

instead just pointing out that a larger value may trigger use of GEQO.
Per Robert Haas.

In passing, do a bit of wordsmithing on the Genetic Query Optimizer section.
This commit is contained in:
Tom Lane 2009-06-02 17:37:55 +00:00
parent 7c8d7a2eec
commit ade91586ea
1 changed files with 35 additions and 15 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.216 2009/04/27 16:27:35 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.217 2009/06/02 17:37:55 tgl Exp $ -->
<chapter Id="runtime-config"> <chapter Id="runtime-config">
<title>Server Configuration</title> <title>Server Configuration</title>
@ -2025,6 +2025,16 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
<sect2 id="runtime-config-query-geqo"> <sect2 id="runtime-config-query-geqo">
<title>Genetic Query Optimizer</title> <title>Genetic Query Optimizer</title>
<para>
The genetic query optimizer (GEQO) is an algorithm that does query
planning using heuristic searching. This reduces planning time for
complex queries (those joining many relations), at the cost of producing
plans that are sometimes inferior to those found by the normal
exhaustive-search algorithm. Also, GEQO's searching is randomized and
therefore its plans may vary nondeterministically.
For more information see <xref linkend="geqo">.
</para>
<variablelist> <variablelist>
<varlistentry id="guc-geqo" xreflabel="geqo"> <varlistentry id="guc-geqo" xreflabel="geqo">
@ -2041,11 +2051,10 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
<term><varname>geqo</varname> (<type>boolean</type>)</term> <term><varname>geqo</varname> (<type>boolean</type>)</term>
<listitem> <listitem>
<para> <para>
Enables or disables genetic query optimization, which is an Enables or disables genetic query optimization.
algorithm that attempts to do query planning without This is on by default. It is usually best not to turn it off in
exhaustive searching. This is on by default. The production; the <varname>geqo_threshold</varname> variable provides a
<varname>geqo_threshold</varname> variable provides a more more granular way to control use of GEQO.
granular way to disable GEQO for certain classes of queries.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -2075,8 +2084,8 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
</indexterm> </indexterm>
<listitem> <listitem>
<para> <para>
Controls the trade off between planning time and query plan Controls the trade-off between planning time and query plan
efficiency in GEQO. This variable must be an integer in the quality in GEQO. This variable must be an integer in the
range from 1 to 10. The default value is five. Larger values range from 1 to 10. The default value is five. Larger values
increase the time spent doing query planning, but also increase the time spent doing query planning, but also
increase the likelihood that an efficient query plan will be increase the likelihood that an efficient query plan will be
@ -2100,11 +2109,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
</indexterm> </indexterm>
<listitem> <listitem>
<para> <para>
Controls the pool size used by GEQO. The pool size is the Controls the pool size used by GEQO, that is the
number of individuals in the genetic population. It must be number of individuals in the genetic population. It must be
at least two, and useful values are typically 100 to 1000. If at least two, and useful values are typically 100 to 1000. If
it is set to zero (the default setting) then a suitable it is set to zero (the default setting) then a suitable
default is chosen based on <varname>geqo_effort</varname> and value is chosen based on <varname>geqo_effort</varname> and
the number of tables in the query. the number of tables in the query.
</para> </para>
</listitem> </listitem>
@ -2117,11 +2126,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
</indexterm> </indexterm>
<listitem> <listitem>
<para> <para>
Controls the number of generations used by GEQO. Generations Controls the number of generations used by GEQO, that is
specifies the number of iterations of the algorithm. It must the number of iterations of the algorithm. It must
be at least one, and useful values are in the same range as be at least one, and useful values are in the same range as
the pool size. If it is set to zero (the default setting) the pool size. If it is set to zero (the default setting)
then a suitable default is chosen based on then a suitable value is chosen based on
<varname>geqo_pool_size</varname>. <varname>geqo_pool_size</varname>.
</para> </para>
</listitem> </listitem>
@ -2252,10 +2261,15 @@ SELECT * FROM parent WHERE key = 2400;
The planner will merge sub-queries into upper queries if the The planner will merge sub-queries into upper queries if the
resulting <literal>FROM</literal> list would have no more than resulting <literal>FROM</literal> list would have no more than
this many items. Smaller values reduce planning time but might this many items. Smaller values reduce planning time but might
yield inferior query plans. The default is eight. It is usually yield inferior query plans. The default is eight.
wise to keep this less than <xref linkend="guc-geqo-threshold">.
For more information see <xref linkend="explicit-joins">. For more information see <xref linkend="explicit-joins">.
</para> </para>
<para>
Setting this value to <xref linkend="guc-geqo-threshold"> or more
may trigger use of the GEQO planner, resulting in nondeterministic
plans. See <xref linkend="runtime-config-query-geqo">.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -2285,6 +2299,12 @@ SELECT * FROM parent WHERE key = 2400;
order they desire explicitly. order they desire explicitly.
For more information see <xref linkend="explicit-joins">. For more information see <xref linkend="explicit-joins">.
</para> </para>
<para>
Setting this value to <xref linkend="guc-geqo-threshold"> or more
may trigger use of the GEQO planner, resulting in nondeterministic
plans. See <xref linkend="runtime-config-query-geqo">.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>