Skip site navigation (1) Skip section navigation (2)

pgsql: Speed up in-memory tuplesorting.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Speed up in-memory tuplesorting.
Date: 2012-02-15 17:20:37
Message-ID: E1RxiWz-00046f-GN@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Speed up in-memory tuplesorting.

Per recent work by Peter Geoghegan, it's significantly faster to
tuplesort on a single sortkey if ApplySortComparator is inlined into
quicksort rather reached via a function pointer.  It's also faster
in general to have a version of quicksort which is specialized for
sorting SortTuple objects rather than objects of arbitrary size and
type.  This requires a couple of additional copies of the quicksort
logic, which in this patch are generate using a Perl script.  There
might be some benefit in adding further specializations here too,
but thus far it's not clear that those gains are worth their weight
in code footprint.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/337b6f5ecf05b21b5e997986884d097d60e4e3d0

Modified Files
--------------
src/backend/Makefile                      |    4 +-
src/backend/utils/sort/.gitignore         |    1 +
src/backend/utils/sort/Makefile           |    8 +
src/backend/utils/sort/gen_qsort_tuple.pl |  232 +++++++++++++++++++++++++++++
src/backend/utils/sort/tuplesort.c        |   68 +++++----
src/port/qsort.c                          |    2 +-
src/port/qsort_arg.c                      |    2 +-
src/tools/msvc/Solution.pm                |    8 +
8 files changed, 289 insertions(+), 36 deletions(-)

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2012-02-15 17:50:41
Subject: pg_upgrade message
Previous:From: Robert HaasDate: 2012-02-15 17:03:24
Subject: Re: bitfield and gcc

pgsql-committers by date

Next:From: Fujii MasaoDate: 2012-02-15 17:28:16
Subject: Re: pgsql: Have pg_receivexlog always send an invalid log position in statu
Previous:From: Robert HaasDate: 2012-02-15 15:57:06
Subject: pgsql: More regression tests for LEAKPROOF/NOT LEAKPROOF stuff.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group