pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Greg Stark <gsstark@mit.edu>
Cc: Cristian Prieto <cristian@clickdiario.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Any way to optimize GROUP BY queries?
Date: Tue, 20 Dec 2005 13:47:10 -0600
Message-ID: <20051220194710.GJ28771@pervasive.com> (raw)
In-Reply-To: <87wti0ak60.fsf@stark.xeocode.com>
References: <00d701c604c1$e6945d80$6500a8c0@gt.ClickDiario.local>
	<87wti0ak60.fsf@stark.xeocode.com>

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



view thread (4+ messages)  latest in thread

Message-ID: <20051220194710.GJ28771@pervasive.com>
Permalink:  ../20051220194710.GJ28771@pervasive.com/
Also on:    postgresql.org/message-id/20051220194710.GJ28771@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, gsstark@mit.edu, cristian@clickdiario.com
  Subject: Re: Any way to optimize GROUP BY queries?
  In-Reply-To: <20051220194710.GJ28771@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox