summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-09-29 10:20:44 -0400
committerRobert Haas <rhaas@postgresql.org>2017-09-29 10:25:44 -0400
commit8b304b8b72b0a60f1968d39f01cf817c8df863ec (patch)
treeae476a3b7697ba10e7f9cb8e4dcb552f7632a84a /doc/src
parentd2773f9bcd980cf6ed720928cd0700196608ef19 (diff)
Remove replacement selection sort.
At the time replacement_sort_tuples was introduced, there were still cases where replacement selection sort noticeably outperformed using quicksort even for the first run. However, those cases seem to have evaporated as a result of further improvements made since that time (and perhaps also advances in CPU technology). So remove replacement selection and the controlling GUC entirely. This makes tuplesort.c noticeably simpler and probably paves the way for further optimizations someone might want to do later. Peter Geoghegan, with review and testing by Tomas Vondra and me. Discussion: https://postgr.es/m/CAH2-WzmmNjG_K0R9nqYwMq3zjyJJK+hCbiZYNGhAy-Zyjs64GQ@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml39
-rw-r--r--doc/src/sgml/release-9.6.sgml2
2 files changed, 1 insertions, 40 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 4b265d9e40c..c13f60230f9 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1505,45 +1505,6 @@ include_dir 'conf.d'
</listitem>
</varlistentry>
- <varlistentry id="guc-replacement-sort-tuples" xreflabel="replacement_sort_tuples">
- <term><varname>replacement_sort_tuples</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>replacement_sort_tuples</> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When the number of tuples to be sorted is smaller than this number,
- a sort will produce its first output run using replacement selection
- rather than quicksort. This may be useful in memory-constrained
- environments where tuples that are input into larger sort operations
- have a strong physical-to-logical correlation. Note that this does
- not include input tuples with an <emphasis>inverse</emphasis>
- correlation. It is possible for the replacement selection algorithm
- to generate one long run that requires no merging, where use of the
- default strategy would result in many runs that must be merged
- to produce a final sorted output. This may allow sort
- operations to complete sooner.
- </para>
- <para>
- The default is 150,000 tuples. Note that higher values are typically
- not much more effective, and may be counter-productive, since the
- priority queue is sensitive to the size of available CPU cache, whereas
- the default strategy sorts runs using a <firstterm>cache
- oblivious</firstterm> algorithm. This property allows the default sort
- strategy to automatically and transparently make effective use
- of available CPU cache.
- </para>
- <para>
- Setting <varname>maintenance_work_mem</varname> to its default
- value usually prevents utility command external sorts (e.g.,
- sorts used by <command>CREATE INDEX</> to build B-Tree
- indexes) from ever using replacement selection sort, unless the
- input tuples are quite wide.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry id="guc-autovacuum-work-mem" xreflabel="autovacuum_work_mem">
<term><varname>autovacuum_work_mem</varname> (<type>integer</type>)
<indexterm>
diff --git a/doc/src/sgml/release-9.6.sgml b/doc/src/sgml/release-9.6.sgml
index dc811c4ca5d..09b6b902547 100644
--- a/doc/src/sgml/release-9.6.sgml
+++ b/doc/src/sgml/release-9.6.sgml
@@ -5140,7 +5140,7 @@ and many others in the same vein
The new approach makes better use of the <acronym>CPU</> cache
for typical cache sizes and data volumes. Where necessary,
the behavior can be adjusted via the new configuration parameter
- <xref linkend="guc-replacement-sort-tuples">.
+ <literal>replacement_sort_tuples</literal>.
</para>
</listitem>