pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Magnus Naeslund(t) <mag@fbab.net>
To: Stef <svb@ucs.co.za>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query kills machine.
Date: Tue, 24 Aug 2004 16:08:33 +0200
Message-ID: <412B4BE1.8080808@fbab.net> (raw)
In-Reply-To: <20040824153014.2a11d228@svb.ucs.co.za>
References: <20040824103240.4d909777@svb.ucs.co.za>
	<412B05A2.8070301@familyhealth.com.au>
	<20040824153014.2a11d228@svb.ucs.co.za>

Stef wrote:

> Christopher Kings-Lynne mentioned :
> => sort_mem = 4096
> 
> Reducing sort_mem to 4096 seems to make it run in a reasonable time
> again. Any idea why? The database does a whole lot of huge sorts
> every day, so I thought upping this parameter would help.
> 
> A couple of queries do seem to run slower now that I reduced
> the sort_mem. 
> 
> The shared buffers still makes a significant difference when I increase it.
> 

Well you have to take in account that sort_mem is not the total memory 
allocated for sorting but per connection and in complex expressions 
serveral times that too.

So if you sort a lot it can push your operating system off the cliff and 
it might start reaping things that shouldn't be reaped and start swapping.

If that happens _everything_ on that box will get slow...

Shared buffers on the other hand is only allocated once.

Regards,
Magnus



view thread (7+ messages)  latest in thread

Message-ID: <412B4BE1.8080808@fbab.net>
Permalink:  ../412B4BE1.8080808@fbab.net/
Also on:    postgresql.org/message-id/412B4BE1.8080808@fbab.net

 · 

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: mag@fbab.net, svb@ucs.co.za
  Subject: Re: Query kills machine.
  In-Reply-To: <412B4BE1.8080808@fbab.net>

* 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