1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.216 2009/04/27 16:27:35 momjian Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.217 2009/06/02 17:37:55 tgl Exp $ -->
2
2
3
3
<chapter Id="runtime-config">
4
4
<title>Server Configuration</title>
@@ -2025,6 +2025,16 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
2025
2025
<sect2 id="runtime-config-query-geqo">
2026
2026
<title>Genetic Query Optimizer</title>
2027
2027
2028
+ <para>
2029
+ The genetic query optimizer (GEQO) is an algorithm that does query
2030
+ planning using heuristic searching. This reduces planning time for
2031
+ complex queries (those joining many relations), at the cost of producing
2032
+ plans that are sometimes inferior to those found by the normal
2033
+ exhaustive-search algorithm. Also, GEQO's searching is randomized and
2034
+ therefore its plans may vary nondeterministically.
2035
+ For more information see <xref linkend="geqo">.
2036
+ </para>
2037
+
2028
2038
<variablelist>
2029
2039
2030
2040
<varlistentry id="guc-geqo" xreflabel="geqo">
@@ -2041,11 +2051,10 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
2041
2051
<term><varname>geqo</varname> (<type>boolean</type>)</term>
2042
2052
<listitem>
2043
2053
<para>
2044
- Enables or disables genetic query optimization, which is an
2045
- algorithm that attempts to do query planning without
2046
- exhaustive searching. This is on by default. The
2047
- <varname>geqo_threshold</varname> variable provides a more
2048
- granular way to disable GEQO for certain classes of queries.
2054
+ Enables or disables genetic query optimization.
2055
+ This is on by default. It is usually best not to turn it off in
2056
+ production; the <varname>geqo_threshold</varname> variable provides a
2057
+ more granular way to control use of GEQO.
2049
2058
</para>
2050
2059
</listitem>
2051
2060
</varlistentry>
@@ -2075,8 +2084,8 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
2075
2084
</indexterm>
2076
2085
<listitem>
2077
2086
<para>
2078
- Controls the trade off between planning time and query plan
2079
- efficiency in GEQO. This variable must be an integer in the
2087
+ Controls the trade- off between planning time and query plan
2088
+ quality in GEQO. This variable must be an integer in the
2080
2089
range from 1 to 10. The default value is five. Larger values
2081
2090
increase the time spent doing query planning, but also
2082
2091
increase the likelihood that an efficient query plan will be
@@ -2100,11 +2109,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
2100
2109
</indexterm>
2101
2110
<listitem>
2102
2111
<para>
2103
- Controls the pool size used by GEQO. The pool size is the
2112
+ Controls the pool size used by GEQO, that is the
2104
2113
number of individuals in the genetic population. It must be
2105
2114
at least two, and useful values are typically 100 to 1000. If
2106
2115
it is set to zero (the default setting) then a suitable
2107
- default is chosen based on <varname>geqo_effort</varname> and
2116
+ value is chosen based on <varname>geqo_effort</varname> and
2108
2117
the number of tables in the query.
2109
2118
</para>
2110
2119
</listitem>
@@ -2117,11 +2126,11 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
2117
2126
</indexterm>
2118
2127
<listitem>
2119
2128
<para>
2120
- Controls the number of generations used by GEQO. Generations
2121
- specifies the number of iterations of the algorithm. It must
2129
+ Controls the number of generations used by GEQO, that is
2130
+ the number of iterations of the algorithm. It must
2122
2131
be at least one, and useful values are in the same range as
2123
2132
the pool size. If it is set to zero (the default setting)
2124
- then a suitable default is chosen based on
2133
+ then a suitable value is chosen based on
2125
2134
<varname>geqo_pool_size</varname>.
2126
2135
</para>
2127
2136
</listitem>
@@ -2252,10 +2261,15 @@ SELECT * FROM parent WHERE key = 2400;
2252
2261
The planner will merge sub-queries into upper queries if the
2253
2262
resulting <literal>FROM</literal> list would have no more than
2254
2263
this many items. Smaller values reduce planning time but might
2255
- yield inferior query plans. The default is eight. It is usually
2256
- wise to keep this less than <xref linkend="guc-geqo-threshold">.
2264
+ yield inferior query plans. The default is eight.
2257
2265
For more information see <xref linkend="explicit-joins">.
2258
2266
</para>
2267
+
2268
+ <para>
2269
+ Setting this value to <xref linkend="guc-geqo-threshold"> or more
2270
+ may trigger use of the GEQO planner, resulting in nondeterministic
2271
+ plans. See <xref linkend="runtime-config-query-geqo">.
2272
+ </para>
2259
2273
</listitem>
2260
2274
</varlistentry>
2261
2275
@@ -2285,6 +2299,12 @@ SELECT * FROM parent WHERE key = 2400;
2285
2299
order they desire explicitly.
2286
2300
For more information see <xref linkend="explicit-joins">.
2287
2301
</para>
2302
+
2303
+ <para>
2304
+ Setting this value to <xref linkend="guc-geqo-threshold"> or more
2305
+ may trigger use of the GEQO planner, resulting in nondeterministic
2306
+ plans. See <xref linkend="runtime-config-query-geqo">.
2307
+ </para>
2288
2308
</listitem>
2289
2309
</varlistentry>
2290
2310
0 commit comments