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

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Michael Paquier <michael@paquier.xyz>, Magnus Hagander <magnus@hagander.net>, sk@zsrv.org, Robert Haas <robertmhaas@gmail.com>, Fujii Masao <masao.fujii@gmail.com>, Ashutosh Sharma <ashu.coek88@gmail.com>, Euler Taveira <euler@timbira.com.br>, Pg Hackers <pgsql-hackers@postgresql.org>, Simon Riggs <simon@2ndquadrant.com>, Dave Page <dpage@pgadmin.org>
Date: 2018-11-22T13:32:36Z
Lists: pgsql-hackers
On 2018-Nov-20, Haribabu Kommi wrote:

> > > 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.
> >
> > Hmm, can we use 0 as default value without any such caveat?
> 
> Yes, with strict and 0 as default value can work.
> If there is no problem, I can go ahead with the above changes?

I'm not sure I understand this proposal.  Does this mean that passing -1
as databaseid / userid would match all databases/users, and passing 0 as
queryid would match all queries?  This would be suprising, since OID is
unsigned so -1 is a possibly valid value ...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Extend pg_stat_statements_reset to reset statistics specific to a

  2. Default monitoring roles