pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Nuzum <matt.followers@gmail.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Preventing query from hogging server
Date: Thu, 24 Mar 2005 14:13:01 -0600
Message-ID: <42431f52.4700af57.2963.ffffe2b8@mx.gmail.com> (raw)
In-Reply-To: <5246.1111694535@sss.pgh.pa.us>


> I would strongly suggest doing the min and max calculations together:
> 
> 	select groupid, min(col), max(col) from ...
>
> because if you do them in two separate queries 90% of the effort will be
> duplicated.
>
>			regards, tom lane

Thanks. Other than avoiding using too much sort mem, is there anything else
I can do to ensure this query doesn't starve other processes for resources?

Doing the explain analyze only increases my server load by 1 and seems to
readily relinquish CPU time, but previously when I had been running a test
query my server load rose to unacceptable levels.

FWIW, the explain was run from psql running on the db server, the test query
the other day was run from one of the webservers. Should I run this on the
db server to minimize load?

-- 
Matthew Nuzum <matt@followers.net>
www.followers.net - Makers of "Elite Content Management System"
View samples of Elite CMS in action by visiting
http://www.followers.net/portfolio/




view thread (9+ messages)  latest in thread

Message-ID: <42431f52.4700af57.2963.ffffe2b8@mx.gmail.com>
Permalink:  ../42431f52.4700af57.2963.ffffe2b8@mx.gmail.com/
Also on:    postgresql.org/message-id/42431f52.4700af57.2963.ffffe2b8@mx.gmail.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: matt.followers@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Preventing query from hogging server
  In-Reply-To: <42431f52.4700af57.2963.ffffe2b8@mx.gmail.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