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

"Matthew Nuzum" <matt.followers@gmail.com> writes:
> 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?

Not a lot.

> 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.

Interesting.  EXPLAIN ANALYZE is going to cause a bunch of
gettimeofday() calls to be inserted ... maybe your kernel takes those as
process preemption points?  Seems unlikely, but ...

> 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?

Since it's an insert/select, psql isn't participating in the data flow.
It's not going to matter where the psql process is.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <5369.1111695542@sss.pgh.pa.us>
Permalink:  ../5369.1111695542@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5369.1111695542@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, matt@followers.net
  Subject: Re: Preventing query from hogging server
  In-Reply-To: <5369.1111695542@sss.pgh.pa.us>

* 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