Re: Memory usage during sorting - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Memory usage during sorting
Date
Msg-id CAM-w4HOT2txOZ+nJLjSXDeJzK5h8V5Gm+L7JQoZ_tjcM-U=xjA@mail.gmail.com
Whole thread Raw
In response to Re: Memory usage during sorting  (Peter Geoghegan <peter@2ndquadrant.com>)
Responses Re: Memory usage during sorting
List pgsql-hackers
On Fri, Apr 13, 2012 at 7:01 PM, Peter Geoghegan <peter@2ndquadrant.com> wrote:
> Well, timsort is specifically designed to take advantage of pre-sorted
> data. It does appear to have a lot of traction, as wikipedia points
> out:

I hadn't heard of it. But reading up on it it does seem like a good
fit for us. It trades some additional storage -- an array of pointers
into the sort array where in our case the pointers would be much
smaller than a whole SortTuple -- for fewer comparisons -- which in
our case are often much slower than a simple integer comparison.

-- 
greg


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Patch: add timing of buffer I/O requests
Next
From: Magnus Hagander
Date:
Subject: Re: column name of pg_stat_replication.backend_start