Thread: Fully replacing ps_status (was Re: [COMMITTERS] pgsql: Add GUC update_process_title to control whether 'ps' display is)

momjian@postgresql.org (Bruce Momjian) writes:
> Add GUC update_process_title to control whether 'ps' display is updated
> for every command, default to on.

It strikes me that the ps_status support provides one important bit of
information that is currently hard to get elsewhere; specifically, the
"waiting" flag that gets added while blocked on a lock.  You can find
out if a process is blocked by looking in pg_locks, but that's a fairly
expensive probe in itself and then you have to join to pg_stat_activity
to make any sense of it.  I wonder if we should add a "waiting" boolean
column to pg_stat_activity?  Given the new implementation of
pg_stat_activity, updating such a flag would be pretty cheap.
        regards, tom lane


Re: Fully replacing ps_status (was Re: [COMMITTERS] pgsql:

From
Bruce Momjian
Date:
Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Add GUC update_process_title to control whether 'ps' display is updated
> > for every command, default to on.
> 
> It strikes me that the ps_status support provides one important bit of
> information that is currently hard to get elsewhere; specifically, the
> "waiting" flag that gets added while blocked on a lock.  You can find
> out if a process is blocked by looking in pg_locks, but that's a fairly
> expensive probe in itself and then you have to join to pg_stat_activity
> to make any sense of it.  I wonder if we should add a "waiting" boolean
> column to pg_stat_activity?  Given the new implementation of
> pg_stat_activity, updating such a flag would be pretty cheap.

Nice idea.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: Fully replacing ps_status (was Re: [COMMITTERS] pgsql:

From
Mark Kirkwood
Date:
Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
>> Add GUC update_process_title to control whether 'ps' display is updated
>> for every command, default to on.
> 
> It strikes me that the ps_status support provides one important bit of
> information that is currently hard to get elsewhere; specifically, the
> "waiting" flag that gets added while blocked on a lock.  You can find
> out if a process is blocked by looking in pg_locks, but that's a fairly
> expensive probe in itself and then you have to join to pg_stat_activity
> to make any sense of it.  I wonder if we should add a "waiting" boolean
> column to pg_stat_activity?  Given the new implementation of
> pg_stat_activity, updating such a flag would be pretty cheap.
> 
>

Funny - today I was just thinking how useful that would be!

Cheers

Mark


* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Add GUC update_process_title to control whether 'ps' display is updated
> > for every command, default to on.
>
> It strikes me that the ps_status support provides one important bit of
> information that is currently hard to get elsewhere; specifically, the
> "waiting" flag that gets added while blocked on a lock.  You can find
> out if a process is blocked by looking in pg_locks, but that's a fairly
> expensive probe in itself and then you have to join to pg_stat_activity
> to make any sense of it.  I wonder if we should add a "waiting" boolean
> column to pg_stat_activity?  Given the new implementation of
> pg_stat_activity, updating such a flag would be pretty cheap.

That would be an *excellent* addition..  Honestly, I think it'd be nice
to get a 'NOTICE' in such cases too, but having it in pg_stat_activity
will help alot.
Thanks,
    Stephen

* Stephen Frost (sfrost@snowman.net) wrote:
> That would be an *excellent* addition..  Honestly, I think it'd be nice
> to get a 'NOTICE' in such cases too, but having it in pg_stat_activity
> will help alot.

Additionally, Tom, and I hate to point this out here but I don't see
much of an alternative; your mail system blocked my mail and apparently
would block any mail from theplanet.com (a rather large hosting company
based in Texas).  Having been harrassed by their support folks for
running a couple rather large mailing lists (the MythTV ones at
mythtv.org) more than once I'm thinking this is a rather poor RBL.  I'd
encourage you to drop it in favor of something a bit more sane.
Thanks,
    Stephen