Re: PoC: Partial sort

Alexander Korotkov <aekorotkov@gmail.com>

From: Alexander Korotkov <aekorotkov@gmail.com>
To: Peter Geoghegan <pg@heroku.com>
Cc: Andreas Karlsson <andreas@proxel.se>, David Rowley <dgrowleyml@gmail.com>, Marti Raudsepp <marti@juffo.org>, Robert Haas <robertmhaas@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@2ndquadrant.com>, Martijn van Oosterhout <kleptog@svana.org>
Date: 2016-09-13T08:32:51Z
Lists: pgsql-hackers

Attachments

On Fri, Apr 8, 2016 at 10:09 PM, Peter Geoghegan <pg@heroku.com> wrote:

> On Wed, Mar 30, 2016 at 8:02 AM, Alexander Korotkov
> <aekorotkov@gmail.com> wrote:
> > Hmm... I'm not completely agree with that. In typical usage partial sort
> > should definitely use quicksort.  However, fallback to other sort
> methods is
> > very useful.  Decision of partial sort usage is made by planner.  But
> > planner makes mistakes.  For example, our HashAggregate is purely
> in-memory.
> > In the case of planner mistake it causes OOM.  I met such situation in
> > production and not once.  This is why I'd like partial sort to have
> graceful
> > degradation for such cases.
>
> I think that this should be moved to the next CF, unless a committer
> wants to pick it up today.
>

Patch was rebased to current master.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Implement Incremental Sort

  2. Improve memory management for external sorts.