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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Vladimir Borodin <root(at)simply(dot)name>, 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>
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date: 2016-02-02 14:12:14
Message-ID: CAA4eK1+n_u-N5WbDoTOyX5k9GCehPOV88N7YD26EDGN1SUtj+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 1, 2016 at 7:10 PM, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
wrote:

> On Sun, Jan 31, 2016 at 6:55 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
>
>> On Thu, Jan 28, 2016 at 9:16 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
>> wrote:
>> >
>> > On Thu, Jan 28, 2016 at 2:12 AM, Robert Haas <robertmhaas(at)gmail(dot)com>
>> wrote:
>> > >
>> > > On Tue, Jan 26, 2016 at 3:10 AM, andres(at)anarazel(dot)de <
>> andres(at)anarazel(dot)de> wrote:
>> > > > I do think there's a considerable benefit in improving the
>> > > > instrumentation here, but his strikes me as making live more
>> complex for
>> > > > more users than it makes it easier. At the very least this should be
>> > > > split into two fields (type & what we're actually waiting on). I
>> also
>> > > > strongly suspect we shouldn't use in band signaling ("process not
>> > > > waiting"), but rather make the field NULL if we're not waiting on
>> > > > anything.
>> > >
>> > > +1 for splitting it into two fields.
>> > >
>> >
>> > I will take care of this.
>> >
>>
>> As discussed, I have added a new field wait_event_type along with
>> wait_event in pg_stat_activity. Changed the code return NULL, if
>> backend is not waiting. Updated the docs as well.
>>
>
> I wonder if we can use 4-byte wait_event_info more efficiently.
> LWLock number in the tranche would be also useful information to expose.
> Using lwlock number user can determine if there is high concurrency for
> single lwlock in tranche or it is spread over multiple lwlocks.
>

So what you are suggesting is that have an additional information
like sub_wait_event and it will display lock number for the LWLocks
which belong to tranche and otherwise it will be NULL for HWLocks
or Individual LWLocks. I see the value in have one more field, but
just displaying some number and that too is not exact in some cases
like where LWLocks are more doesn't sound to be very informative.

Any body else have an opinion on this matter?

> I think it would be enough to have 6 bits for event class id and 10 bit
> for event id. So, it would be maximum 64 event classes and maximum 1024
> events per class. These limits seem to be fair enough for me.
>

I also think those are fair limits, let me try to shrink those into
number of bits suggested by you.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-02-02 14:48:39 Re: proposal: PL/Pythonu - function ereport
Previous Message Robert Haas 2016-02-02 14:10:00 Re: Fwd: Core dump with nested CREATE TEMP TABLE