pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Use quicksort, not replacement selection, for external sorting.
Date: Fri, 08 Apr 2016 06:39:48 +0000
Message-ID: <E1aoQ56-0001hD-SR@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Use quicksort, not replacement selection, for external sorting.

We still use replacement selection for the first run of the sort only
and only when the number of tuples is relatively small.  Otherwise,
the first run, and subsequent runs in all cases, are produced using
quicksort.  This tends to be faster except perhaps for very small
amounts of working memory.

Peter Geoghegan, reviewed by Tomas Vondra, Jeff Janes, Mithun Cy,
Greg Stark, and me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0711803775a37e0bf39d7efdd1e34d9d7e640ea1

Modified Files
--------------
doc/src/sgml/config.sgml                      |  39 +++
src/backend/optimizer/path/costsize.c         |   6 +-
src/backend/utils/init/globals.c              |   1 +
src/backend/utils/misc/guc.c                  |  10 +
src/backend/utils/misc/postgresql.conf.sample |   1 +
src/backend/utils/sort/tuplesort.c            | 463 +++++++++++++++++++++-----
src/include/miscadmin.h                       |   1 +
7 files changed, 430 insertions(+), 91 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (4+ messages)  latest in thread

Message-ID: <E1aoQ56-0001hD-SR@gemulon.postgresql.org>
Permalink:  ../E1aoQ56-0001hD-SR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aoQ56-0001hD-SR@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Use quicksort, not replacement selection, for external sorting.
  In-Reply-To: <E1aoQ56-0001hD-SR@gemulon.postgresql.org>
  References: <E1aoQ56-0001hD-SR@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox