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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, "aekorotkov(at)gmail(dot)com" <aekorotkov(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date: 2015-07-25 10:54:45
Message-ID: CAA4eK1JVoWqrdaMLv63i46_vysuDOzGFwzn__VDXzdTn7T9bhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 24, 2015 at 1:12 PM, Ildus Kurbangaliev <
i(dot)kurbangaliev(at)postgrespro(dot)ru> wrote:
>
>
> > On Jul 24, 2015, at 7:26 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:
> >
> >
> > 2.
> > +const char *
> > +pgstat_get_wait_event_name(uint8 classId, uint8 eventId)
> > {
> > ..
> > }
> >
> > I don't understand why a single WaitEventType enum is not sufficient
> > as in the patch provided by me and why we need to divide it into
> > separate structures for each kind of wait, I find that way easily
> > understandable.
>
> In current patch if somebody adds new lock or individual lwlock he just
add
> its name to the corresponding array. With WaitEventType first of all he
suppose to
> know about WaitEventType,

That anyway he has to do it either you go by defining individual arrays
or having unified WaitEventType enum for individual arrays he has to
find out that array. Another thing is with that you can just encapsulate
this information in one byte in structure PgBackendStatus, rather than
using more number of bytes (4 bytes) and I think the function for reporting
Waitevent will be much more simplified.

I think it is better if we just implement the idea of tranche's on top of my
patch and do the other remaining work like setting of bwaiting correctly
as mentioned upthread.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-07-25 11:52:10 Re: [PATCH] postgres_fdw extension support
Previous Message Pavel Stehule 2015-07-25 09:27:52 Re: proposal: multiple psql option -c