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

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: sk(at)zsrv(dot)org
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Date: 2018-07-02 05:20:54
Message-ID: CAJrrPGfn12ySuoxzqj4b5sCqEsTeJw+mD6Ni1CgbkbPBNzZ7dQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 29, 2018 at 6:14 PM Sergei Kornilov <sk(at)zsrv(dot)org> wrote:

> Hello
> Thank you for update
>

Thanks for the review.

> It may be better to use NULL as the default value at sql level.
>

Changed.

> > ereport(LOG, (errmsg("userid %u, dbid %u, queryid %ld does not exist",
> userid, dbid, queryid)));
> I think LOG level is not useful here. In common case this is server log
> only. How about WARNING? Or just ignore. Want remove row? Here is no such
> row anymore, all fine.
>

I went with removing of ereport.

> Also we can return num_remove instead of void. I think this is even
> better. But this break backward compatibility and we need something like
> pg_stat_statements_reset_1_6
>

Changed. Returning removed rows is nice than just void.

> > By default, this function can only be executed by superusers.
> Can you also update this phrase in pg_stat_statements_reset documentation?
> Beginning from 1.5 version this is not true, reset can be used by any user
> with pg_read_all_stats role.
>

Doc is updated and also separate thread is started for the doc fix [1].
Updated patch attached.

[1] -
https://www.postgresql.org/message-id/CAJrrPGcim%3DQ-7ewhuKr1n3mkeELySC-QeVHGZJJYwaaKMSJRkg%40mail.gmail.com

Regards,
Haribabu Kommi
Fujitsu Australia

Attachment Content-Type Size
0001-pg_stat_statements_reset-to-reset-specific-query-use_v2.patch application/octet-stream 18.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-07-02 05:46:58 Re: Remove mention in docs that foreign keys on partitioned tables are not supported
Previous Message Haribabu Kommi 2018-07-02 05:15:15 pg_stat_statements_reset() function execute permissions doc update