> >> Increasing SORT_MEM would help the constant factor, however...
> >>
> > What is the most amount of SORT_MEM it makes sense to allocate?
>
>I've never experimented with it, but certainly the standard default
>(512K = 0.5M) is pretty small for modern machines. In a 2G machine
>I might try settings around 100M-500M to see what works best. (Note
I currently use 1.4 gigs for "shared mem" in my database (out of 2G) - I
couldn't get PostgreSQL to run with more than that (it might be an OS
limit, Linux 2.2).
I also use 64 megs as a SORT_MEM setting, on the theory that 4 sorts at
once will leave just enough RAM for the rest of my system not to swap.
Cheers,
Doug