Re: External Sort performance patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: External Sort performance patch
Date
Msg-id 7885.1140329716@sss.pgh.pa.us
Whole thread Raw
In response to External Sort performance patch  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-patches
Simon Riggs <simon@2ndquadrant.com> writes:
> The enclosed patch substantially improves large sort performance,

Applied with revisions.  I thought the addition of the Tapestate structs
complicated the notation considerably without really buying anything,
so instead I just made the fixed-size arrays into pointers.  A more
serious objection was that MaxTapes and TapeRange can't be globals,
they have to be struct fields, unless you want to assume that all sorts
in progress at a given time must use identical memory settings.

I also fixed some off-by-one logic in determining the appropriate number
of tapes, and added accounting for tape buffer space.  It was somewhat
reasonable to ignore the LogicalTapeSet space when the number of tapes
was fixed and small, but in the new regime I think it's necessary to
account for the tape buffers while computing memory use.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: add additional options to CREATE TABLE ... AS
Next
From: Tom Lane
Date:
Subject: Re: External Sort performance patch