pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Extend pg_stat_statements_reset to reset statistics specific to
Date: Fri, 11 Jan 2019 03:30:13 +0000
Message-ID: <E1ghnWP-0005lc-20@gemulon.postgresql.org> (raw)

Extend pg_stat_statements_reset to reset statistics specific to a
particular user/db/query.

The function pg_stat_statements_reset() is extended to accept userid, dbid,
and queryid as input parameters.  Now, it can discard the statistics
gathered so far by pg_stat_statements corresponding to the specified
userid, dbid, and queryid.  If no parameter is specified or all the
specified parameters have default value aka 0, it will discard all
statistics as per the old behavior.

The new behavior is useful to get the fresh statistics for a specific
user/database/query without resetting all the existing statistics.

Author: Haribabu Kommi, with few additional changes by me
Reviewed-by: Michael Paquier, Amit Kapila and Fujii Masao
Discussion: https://postgr.es/m/CAJrrPGcyh-gkFswyc6C661K6cknL0XkNqVT0sQt2mFNMR4HRKA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/43cbedab8ff1eef4088807ffc1a64a107de67af6

Modified Files
--------------
contrib/pg_stat_statements/Makefile                |   8 +-
.../expected/pg_stat_statements.out                | 198 +++++++++++++++++++++
.../pg_stat_statements--1.6--1.7.sql               |  22 +++
contrib/pg_stat_statements/pg_stat_statements.c    |  96 ++++++++--
.../pg_stat_statements/pg_stat_statements.control  |   2 +-
.../pg_stat_statements/sql/pg_stat_statements.sql  |  64 +++++++
doc/src/sgml/pgstatstatements.sgml                 | 106 ++++++++---
7 files changed, 455 insertions(+), 41 deletions(-)



Message-ID: <E1ghnWP-0005lc-20@gemulon.postgresql.org>
Permalink:  ../E1ghnWP-0005lc-20@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ghnWP-0005lc-20@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Extend pg_stat_statements_reset to reset statistics specific to
  In-Reply-To: <E1ghnWP-0005lc-20@gemulon.postgresql.org>
  References: <E1ghnWP-0005lc-20@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox