Re: sort_mem sizing (Non-linear Performance) - Mailing list pgsql-general

From Tom Lane
Subject Re: sort_mem sizing (Non-linear Performance)
Date
Msg-id 18012.1022856428@sss.pgh.pa.us
Whole thread Raw
In response to sort_mem sizing (Non-linear Performance)  (Curt Sampson <cjs@cynic.net>)
Responses Re: sort_mem sizing (Non-linear Performance)
List pgsql-general
Curt Sampson <cjs@cynic.net> writes:
> Next I tried to bump the sortmem up to 256 MB, half the physical RAM
> of the machine. I found out the hard way that the back-end doing the
> indexing will grow to something over three times the size of sortmem,
> and proceeded (slowly) to extricate myself from swap hell.

[ scratches head ... ]  The sort code tries very hard to keep track
of how much it's storing.  I wonder why it's so far off?  Perhaps
failing to allow for palloc overhead?  Remind me again of the exact
datatype you were indexing, please.

> But I decided I couldn't spare that much memory for a database doing
> real work, too, and backed down to 32 MB. That got the process down to
> 115 MB (100 MB resident), but oddly enough sped it up even more, shaving
> the sort time by more than 35% from the original.

Looks like the 128Mb case was swapping a lot (note the page faults
count).  That probably explains the difference.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Non-linear Performance
Next
From: Doug Fields
Date:
Subject: Re: Non-linear Performance