Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Sergei Kornilov <sk(at)zsrv(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>
Subject: Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Date: 2018-11-22 11:44:31
Message-ID: CABUevEwKLazvNFh5soWNXpDsq8WMxGKcoRLeOWfDDs=TTf6CNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 22, 2018 at 4:10 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

> On Mon, Nov 19, 2018 at 10:48 AM Haribabu Kommi
> <kommi(dot)haribabu(at)gmail(dot)com> wrote:
> >
> > On Mon, Nov 19, 2018 at 1:37 PM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
> wrote:
> >>
> >> On 2018-Nov-19, Michael Paquier wrote:
> >>
> >> > On Mon, Nov 19, 2018 at 10:41:22AM +1100, Haribabu Kommi wrote:
> >> > > So 6 new functions needs to be added to cover all the above cases,
> >> > > IMO, we may need functions for all combinations, because I feel some
> >> > > user may have the requirement of left out combination, in case if
> we choose
> >> > > only some combinations.
> >> >
> >> > That's bloating the interface in my opinion.
> >>
> >> I understand.
> >>
> >> Let's call for a vote from a larger audience. It's important to get
> >> this interface right, ISTM.
> >
> >
> > Amit suggested another option in another mail, so total viable
> > solutions that are discussed as of now are,
> >
> > 1. Single API with NULL input treat as invalid value
> > 2. Multiple API to deal with NULL input of other values
> > 3. Single API with NULL value to treat them as current user, current
> database
> > and NULL queryid.
> > 4. Single API with -1 as invalid value, treat NULL as no matching. (Only
> problem
> > with this approach is till now -1 is also a valid queryid, but setting
> -1 as queryid
> > needs to be avoided.
> >
>
> As discussed above the problem mentioned by Hari in point-4 won't be
> there if we use a default value as 0.
>
> > I prefer single API. I can go with either 3 or 4.
> >
> > opinion from others?
>
> We don't see many opinions from others, but what I can read here is the
> count:
> Option-3: Michael, Hari
> Option-4: Amit, Hari
> Option-2: Alvaro
>
> As Hari seems to be a bit more inclined towards option-4, I think we
> can proceed with it.
>

If you want more input ont it, I'd vote for either 2 or 4. Between those
two I think I have a slight favor in the direction of 2, but really not
enough to voice strongly. I do feel more strongly that 1 and 3 are not good
options.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-11-22 12:57:22 Re: pg_upgrade supported versions policy
Previous Message Pavel Stehule 2018-11-22 11:42:14 Re: ToDo: show size of partitioned table