11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.235 2004/01/27 16:51:43 neilc Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.236 2004/02/03 17:34:02 tgl Exp $
33-->
44
55<Chapter Id="runtime">
@@ -850,37 +850,41 @@ SET ENABLE_SEQSCAN TO OFF;
850850 </varlistentry>
851851
852852 <varlistentry>
853- <term><varname>sort_mem </varname> (<type>integer</type>)</term>
853+ <term><varname>work_mem </varname> (<type>integer</type>)</term>
854854 <listitem>
855855 <para>
856- Specifies the amount of memory to be used by internal sort operations and
857- hash tables before switching to temporary disk files. The value is
856+ Specifies the amount of memory to be used by internal sort operations
857+ and hash tables before switching to temporary disk files. The value is
858858 specified in kilobytes, and defaults to 1024 kilobytes (1 MB).
859859 Note that for a complex query, several sort or hash operations might be
860860 running in parallel; each one will be allowed to use as much memory
861861 as this value specifies before it starts to put data into temporary
862- files. Also, several running sessions could be doing
863- sort operations simultaneously. So the total memory used could be many
864- times the value of <varname>sort_mem</varname>. Sort operations are used
865- by <literal>ORDER BY</>, merge joins, and <command>CREATE INDEX</>.
862+ files. Also, several running sessions could be doing such operations
863+ concurrently. So the total memory used could be many
864+ times the value of <varname>work_mem</varname>; it is necessary to
865+ keep this fact in mind when choosing the value. Sort operations are
866+ used for <literal>ORDER BY</>, <literal>DISTINCT</>, and
867+ merge joins.
866868 Hash tables are used in hash joins, hash-based aggregation, and
867- hash-based processing of <literal>IN</> subqueries. Because
868- <command>CREATE INDEX</> is used when restoring a database,
869- increasing <varname>sort_mem</varname> before doing a large
870- restore operation can improve performance.
869+ hash-based processing of <literal>IN</> subqueries.
871870 </para>
872871 </listitem>
873872 </varlistentry>
874873
875874 <varlistentry>
876- <term><varname>vacuum_mem </varname> (<type>integer</type>)</term>
875+ <term><varname>maintenance_work_mem </varname> (<type>integer</type>)</term>
877876 <listitem>
878877 <para>
879- Specifies the maximum amount of memory to be used by
880- <command>VACUUM</command> to keep track of to-be-reclaimed
881- rows. The value is specified in kilobytes, and defaults to
882- 8192 kB. Larger settings may improve the speed of
883- vacuuming large tables that have many deleted rows.
878+ Specifies the maximum amount of memory to be used in maintenance
879+ operations, such as <command>VACUUM</command>, <command>CREATE
880+ INDEX</>, and <command>ALTER TABLE ADD FOREIGN KEY</>.
881+ The value is specified in kilobytes, and defaults to 16384 kilobytes
882+ (16 MB). Since only one of these operations can be executed at
883+ a time by a database session, and an installation normally doesn't
884+ have very many of them happening concurrently, it's safe to set this
885+ value significantly larger than <varname>work_mem</varname>. Larger
886+ settings may improve performance for vacuuming and for restoring
887+ database dumps.
884888 </para>
885889 </listitem>
886890 </varlistentry>
@@ -1412,25 +1416,25 @@ SET ENABLE_SEQSCAN TO OFF;
14121416 <para>
14131417 Various tuning parameters for the genetic query optimization
14141418 algorithm. The recommended one to modify is
1415- <varname>geqo_effort</varname>, which can range from 1 to 10 with
1416- a default of 5. Larger values increase the time spent in planning
1417- but make it more likely that a good plan will be found.
1418- <varname>geqo_effort</varname> doesn't actually do anything directly,
1419- it is just used to compute the default values for the other
1420- parameters. If you prefer, you can set the other parameters by hand
1421- instead.
1422- The pool size is the number of individuals in the genetic population.
1423- It must be at least two, and useful values are typically 100 to 1000.
1424- If it is set to zero (the default setting) then a suitable default
1425- is chosen based on <varname>geqo_effort</varname> and the number of
1426- tables in the query.
1427- Generations specifies the number of iterations of the algorithm.
1428- It must be at least one, and useful values are in the same range
1429- as the pool size.
1430- If it is set to zero (the default setting) then a suitable default
1431- is chosen based on the pool size.
1432- The run time of the algorithm is roughly proportional to the sum of
1433- pool size and generations.
1419+ <varname>geqo_effort</varname>, which can range from 1 to 10 with
1420+ a default of 5. Larger values increase the time spent in planning
1421+ but make it more likely that a good plan will be found.
1422+ <varname>geqo_effort</varname> doesn't actually do anything directly,
1423+ it is just used to compute the default values for the other
1424+ parameters. If you prefer, you can set the other parameters by hand
1425+ instead.
1426+ The pool size is the number of individuals in the genetic population.
1427+ It must be at least two, and useful values are typically 100 to 1000.
1428+ If it is set to zero (the default setting) then a suitable default
1429+ is chosen based on <varname>geqo_effort</varname> and the number of
1430+ tables in the query.
1431+ Generations specifies the number of iterations of the algorithm.
1432+ It must be at least one, and useful values are in the same range
1433+ as the pool size.
1434+ If it is set to zero (the default setting) then a suitable default
1435+ is chosen based on the pool size.
1436+ The run time of the algorithm is roughly proportional to the sum of
1437+ pool size and generations.
14341438 The selection bias is the selective pressure within the
14351439 population. Values can be from 1.50 to 2.00; the latter is the
14361440 default.
@@ -2840,7 +2844,7 @@ $ <userinput>postmaster -o '-S 1024 -s'</userinput>
28402844 <row>
28412845 <entry><option>-S <replaceable>x</replaceable></option><footnoteref linkend="fn.runtime-config-short">
28422846 </entry>
2843- <entry><literal>sort_mem = <replaceable>x</replaceable></></entry>
2847+ <entry><literal>work_mem = <replaceable>x</replaceable></></entry>
28442848 </row>
28452849
28462850 <row>
@@ -3230,7 +3234,7 @@ kernel.shmmax = 134217728
32303234 <para>
32313235 In OS X 10.2 and earlier, edit the file
32323236 <filename>/System/Library/StartupItems/SystemTuning/SystemTuning</>
3233- and change the values in the following commands:
3237+ and change the values in the following commands:
32343238<programlisting>
32353239sysctl -w kern.sysv.shmmax
32363240sysctl -w kern.sysv.shmmin
@@ -3239,7 +3243,7 @@ sysctl -w kern.sysv.shmseg
32393243sysctl -w kern.sysv.shmall
32403244</programlisting>
32413245 In OS X 10.3, these commands have been moved to <filename>/etc/rc</>
3242- and must be edited there.
3246+ and must be edited there.
32433247 </para>
32443248 </listitem>
32453249 </varlistentry>
0 commit comments