pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Track query status
Date: Fri, 30 Mar 2007 01:18:39 +0530
Message-ID: <a97c77030703291248h1c1e0ab3h37e96b9775bc16d7@mail.gmail.com> (raw)
In-Reply-To: <20070328214954.GA17104@phlogiston.dyndns.org>
References: <7539aebb0703281359v5b56cc59xf9e80ad4a74e51d7@mail.gmail.com>
	<20070328214954.GA17104@phlogiston.dyndns.org>

more methods:

1. select * from pg_stat_activity;
see what all running and pid of your current query also.

2. SELECT h.pid AS blocker, w.pid AS blockee
   FROM ONLY pg_locks h, ONLY pg_locks w
  WHERE h."granted" AND NOT w."granted" AND (h.relation = w.relation
AND h."database" = w."database" OR h."transaction" = w."transaction");

make sure that the pid in 1 is not listed as a blockee in result of
above query m, ie The the update is waiting for anything.

3. go the shell , su - postgres ,

strace -p <pid> of the backend got in 1.
observe the system calls , see if anything awkward
there shoud be a lot of writes

4. iostat ofcourse, unless the above sql is the only sql(update)
   running running in server .

my 4cents
regds
mallah.

On 3/29/07, Andrew Sullivan <ajs@crankycanuck.ca> wrote:
> On Wed, Mar 28, 2007 at 04:59:24PM -0400, Sumeet wrote:
> > Hi all,
> >
> > I have ran a update query on a dataset which has about 48 million records
> > and the query is already running for the third day....im so tempted to the
> > kill this query now....is there a way to know if the query is running??
> > here is the query i've ran
>
> 48 million records is a lot.  You oughta see activity with iostat or
> something.
>
> A
>
> --
> Andrew Sullivan  | ajs@crankycanuck.ca
> When my information changes, I alter my conclusions.  What do you do sir?
>                 --attr. John Maynard Keynes
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>



view thread (3+ messages)

Message-ID: <a97c77030703291248h1c1e0ab3h37e96b9775bc16d7@mail.gmail.com>
Permalink:  ../a97c77030703291248h1c1e0ab3h37e96b9775bc16d7@mail.gmail.com/
Also on:    postgresql.org/message-id/a97c77030703291248h1c1e0ab3h37e96b9775bc16d7@mail.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-sql@postgresql.org
  Cc: mallah.rajesh@gmail.com, ajs@crankycanuck.ca
  Subject: Re: Track query status
  In-Reply-To: <a97c77030703291248h1c1e0ab3h37e96b9775bc16d7@mail.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