Re: Any way to optimize GROUP BY queries?

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Cristian Prieto <cristian(at)clickdiario(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Any way to optimize GROUP BY queries?
Date: 2005-12-20 19:47:10
Message-ID: 20051220194710.GJ28771@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Anjan Dave 2005-12-20 19:50:03 Re: High context switches occurring
Previous Message Jim C. Nasby 2005-12-20 19:34:56 Re: PostgreSQL and Ultrasparc T1