Thread: Track query status

Track query status

From
Sumeet
Date:
Hi all,<br /><br />I have ran a update query on a dataset which has about 48 million records and the query is already
runningfor the third day....im so tempted to the kill this query now....is there a way to know if the query is
running??<br />here is the query i've ran<br /><br />UPDATE ma SET av=to_tsvector('default',coalesce(name_first,'') ||'
'||coalesce(name_last,''));<br clear="all" /><br /><br />Thanks,<br />Sumeet  

Re: Track query status

From
Andrew Sullivan
Date:
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


Re: Track query status

From
"Rajesh Kumar Mallah"
Date:
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
>