Re: Preventing query from hogging server

From: Tom Lane
Subject: Re: Preventing query from hogging server
Date: ,
Msg-id: 5050.1111693395@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Preventing query from hogging server  ("Matthew Nuzum")
Responses: Re: Preventing query from hogging server  ("Matthew Nuzum")
Re: Preventing query from hogging server  ("Matthew Nuzum")
List: pgsql-performance

Tree view

Preventing query from hogging server  ("Matthew Nuzum", )
 Re: Preventing query from hogging server  (Rosser Schwarz, )
 Re: Preventing query from hogging server  (Tom Lane, )
  Re: Preventing query from hogging server  ("Matthew Nuzum", )
   Re: Preventing query from hogging server  (Tom Lane, )
    Re: Preventing query from hogging server  ("Matthew Nuzum", )
     Re: Preventing query from hogging server  (Tom Lane, )
  Re: Preventing query from hogging server  ("Matthew Nuzum", )
 Re: Preventing query from hogging server  ("Jim C. Nasby", )

"Matthew Nuzum" <> 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


pgsql-performance by date:

From: Mark Lewis
Date:
Subject: Re: Delete query takes exorbitant amount of time
From: Karim Nassar
Date:
Subject: Re: Delete query takes exorbitant amount of time