Thread: meaning of "waiting" column in pg_stat_activity?

meaning of "waiting" column in pg_stat_activity?

From
Chris Curvey
Date:
Just wondering...if a query is "waiting", what is it waiting for?  Is
this only for locks, or can it be for disk, or a memory buffer?  (If
there is a description of the meaning of things in pg_stat_activity
and it's relatives, I'd love a pointer, 'cause I can't seem to find
it.)

--
e-Mail is the equivalent of a postcard written in pencil.  This
message may not have been sent by me, or intended for you.  It may
have been read or even modified while in transit.  e-Mail disclaimers
have the same force in law as a note passed in study hall.  If your
corporate attorney says that you need an disclaimer in your signature,
you need a new corporate attorney.

Re: meaning of "waiting" column in pg_stat_activity?

From
Guillaume Lelarge
Date:
On Mon, 2012-07-23 at 16:13 -0400, Chris Curvey wrote:
> Just wondering...if a query is "waiting", what is it waiting for?

Locks.

>   Is
> this only for locks, or can it be for disk, or a memory buffer?

Only locks.

>   (If
> there is a description of the meaning of things in pg_stat_activity
> and it's relatives, I'd love a pointer, 'cause I can't seem to find
> it.)

There isn't much at the moment. 9.2 docs will be better in that regard.
See
http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW for example (but be careful that
somecolumns of pg_stat_activity change in 9.2). 


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com