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

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Sergei Kornilov <sk@zsrv.org>, Vik Fearing <vik.fearing@2ndquadrant.com>, Haribabu Kommi <kommi.haribabu@gmail.com>, Michael Paquier <michael@paquier.xyz>, Magnus Hagander <magnus@hagander.net>, Fujii Masao <masao.fujii@gmail.com>, Ashutosh Sharma <ashu.coek88@gmail.com>, Euler Taveira de Oliveira <euler@timbira.com.br>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Simon Riggs <simon@2ndquadrant.com>, Dave Page <dpage@pgadmin.org>
Date: 2018-12-15T15:21:19Z
Lists: pgsql-hackers
On 14/12/2018 19:44, Robert Haas wrote:
> I'm showing up very late to the party here, but I like option 1 best.
> I feel like the SQL standard has a pretty clear idea that NULL is how
> you represent a value is unknown, which shows up in a lot of places.
> Deciding that we're going to use a different sentinel value in this
> one case because NULL is a confusing concept in general seems pretty
> strange to me.

[The difference between #1 and #4 is whether "any" is represented as
NULL or 0.]

An example:

select pg_stat_statements_reset(
10,
(select min(oid) from pg_database where datname like 'test%'),
1234);

(This is obviously a weird example, but it illustrates the
language-theoretic point.)

If you have no matching databases, under #1 this would then apply to all
databases.  Under #4 it would not.

-- 
Peter Eisentraut              http://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