Re: Any way to optimize GROUP BY queries? - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Any way to optimize GROUP BY queries?
Date
Msg-id 20051220194710.GJ28771@pervasive.com
Whole thread Raw
In response to Re: Any way to optimize GROUP BY queries?  (Greg Stark <gsstark@mit.edu>)
Responses Re: Any way to optimize GROUP BY queries?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Mon, Dec 19, 2005 at 03:47:35PM -0500, Greg Stark wrote:
> Increase your work_mem (or sort_mem in older postgres versions), you can do
> this for the server as a whole or just for this one session and set it back
> after this one query. You can increase it up until it starts causing swapping
> at which point it would be counter productive.

Just remember that work_memory is per-operation, so it's easy to push
the box into swapping if the workload increases. You didn't say how much
memory you have, but I'd be careful if work_memory * max_connections
gets very much larger than your total memory.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: PostgreSQL and Ultrasparc T1
Next
From: "Anjan Dave"
Date:
Subject: Re: High context switches occurring