Re: RFC: replace pg_stat_activity.waiting with something more descriptive

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Vladimir Borodin <root(at)simply(dot)name>, Александр Коротков <aekorotkov(at)gmail(dot)com>, Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date: 2016-01-20 13:09:44
Message-ID: CA+TgmoZ8Fygx_jpfN4OyQREcpaJ6MiiD2Hh6YTX8Yk-Fv6b3pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 19, 2016 at 11:49 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> My opinion is that storing the information in PGPROC is better because
>> it seems like we can fairly painlessly expose 4 bytes of data that way
>> instead of 1, which is nice.
>
> Okay, do you mean to say that we can place this new 4-byte variable
> in PGPROC at 4-byte aligned boundary, so both read and writes will be
> atomic?

Yes. However, note that you don't need to do anything special to get
it 4-byte aligned. The compiler will do that automatically.

>> On the topic of the UI, I understand that redefining
>> pg_stat_activity.waiting might cause some short-term annoyance. But I
>> think in the long term what we are proposing here is going to be a
>> huge improvement, so I think it's worth the compatibility break. If
>> we say that pg_stat_activity.waiting has to continue meaning "waiting
>> for a heavyweight lock" even though we now also expose (in some other
>> location) information on other kinds of waits, that's going to be
>> confusing to users.
>
> If we want to go via this route, then the first thing which we need to
> decide is whether we want to start displaying the information of
> background processes like WALWriter and others in pg_stat_activity?

That doesn't seem like a particularly good fit - few of the fields are
relevant to that case. We could provide some other way of getting at
the information for background processes if people want, but
personally I'd probably be inclined not to bother with it for right
now.

>> It's better to force people to update their
>> queries once than to have this confusing wart in the system forever.
>> I predict that if we make backward compatibility the priority here,
>> we'll still be explaining it to smart but confused people when 9.6
>> goes EOL.
>
> Valid point, OTOH we can update the docs to say that
> pg_stat_activity.waiting parameter is deprecated and after a
> release or two we can get rid of this parameter.

My impression is that doesn't really ease the pain much. Half the
time we never actually remove the deprecated column, or much later
than predicted, and people don't read the docs and keep relying on it
anyway. So in the end it just makes the process more complicated
without really helping.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2016-01-20 13:50:30 Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)
Previous Message Craig Ringer 2016-01-20 13:02:54 Re: WIP: Failover Slots