Re: Parallel Sort

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Parallel Sort
Date: 2013-05-15 19:03:14
Message-ID: CAM3SWZRg_Vx8vExVVM2avtJiJhZfo3EEABmwiJSgq2zKi88xMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 15, 2013 at 11:32 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> I think that this effort could justify itself independently of any
> attempt to introduce parallelism to in-memory sorting. I abandoned a
> patch to introduce timsort to Postgres, because I knew that there was
> no principled way to reap the benefits.

Just for the record, I attach a patch that introduces a timsort_arg
function as a drop-in replacement for quicksort_arg (including
replacing all of the specializations that went into 9.2). It has been
rebased against master. For what it's worth, if anyone wanted to pick
this up, that would be fine with me.

Don't be fooled by the superficial regression test failures. The tests
in question are subtly wrong, because they rely on a certain ordering
that isn't explicitly requested. Timsort is stable, whereas quicksort
generally isn't stable (our implementation certainly isn't).

--
Peter Geoghegan

Attachment Content-Type Size
timsort.2013_05_15.patch.gz application/x-gzip 13.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-05-15 19:10:21 Re: counting algorithm for incremental matview maintenance
Previous Message Heikki Linnakangas 2013-05-15 18:50:23 Re: streaming replication, "frozen snapshot backup on it" and missing relfile (postgres 9.2.3 on xfs + LVM)