Re: database running slow - Mailing list pgsql-admin

From Andrew Sullivan
Subject Re: database running slow
Date
Msg-id 20030514174606.GR20729@libertyrms.info
Whole thread Raw
In response to Re: database running slow  (Shankar K <shan0075@yahoo.com>)
List pgsql-admin
On Tue, May 13, 2003 at 10:19:55AM -0700, Shankar K wrote:
>
> Define "run-away".  You can look for long-running
> transactions; that might be helpful.
>
> ++ i meant a backend process taking most of the cpu
> cycles and running for ever. so i wanted to figure out
> what those processes were doing and what made them to
> hog the cpu cycles.

You can use the pid of a process to look it up in the system tables.
There's no simple way to identify long-running ones, except to look
for back ends that have been hanging around for a long time (but if
you're using pooling, it won't help you).  Tools like top will be
helpful in identifying processor hogs.

> ++ how to identify those queries. once i have the

If you can identify the process, then you can identify the pid, and
use the pid in the stats tables to get the query.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


pgsql-admin by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Grant Question
Next
From: Andrew Sullivan
Date:
Subject: Re: No flamefest please, MySQL vs. PostgreSQL AGAIN