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 14:43:15 -0500
Message-ID: <5050.1111693395@sss.pgh.pa.us> (raw)
In-Reply-To: <42431001.36c6643c.1b4b.ffffd505@mx.gmail.com>
References: <42431001.36c6643c.1b4b.ffffd505@mx.gmail.com>

"Matthew Nuzum" <matt.followers@gmail.com> writes:
> Here is the query (BTW, there will be a corresponding "max" version of this
> query as well):
> INSERT INTO usage_sessions_min (accountid,atime,sessionid)
> select accountid, min(atime) as atime, sessionid from usage_access 
> group by accountid,sessionid;

How many rows in usage_access?  How many groups do you expect?
(Approximate answers are fine.)  What PG version is this, and
what's your sort_mem setting?

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <5050.1111693395@sss.pgh.pa.us>
Permalink:  ../5050.1111693395@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5050.1111693395@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: <5050.1111693395@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