Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query
Date
Msg-id CAA4eK1J8z2aEoSyd+_V1w+a+2XZgmmYRjGKXeHswEMK16oi_OA@mail.gmail.com
Whole thread Raw
In response to Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: New function pg_stat_statements_reset_query() to resetstatistics of a specific query
List pgsql-hackers
On Thu, Nov 8, 2018 at 1:52 PM Haribabu Kommi <kommi.haribabu@gmail.com> wrote:
> On Thu, Nov 8, 2018 at 4:53 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>> > This patch has changed the pg_stat_statements_reset() function from returning void
>> > to number statements that it reset.
>> >
>>
>> What is the motivation of that change?  It seems to be
>> backward-incompatible change.  I am not telling we can't do it, but do
>> we have strong justification?  One reason, I could see is to allow the
>> user to get the exact value of statements that got reset and maybe
>> that is more helpful as we have now additional parameters in the API,
>> but I am not sure if that is a good justification.
>
>
> Yes, as you said that is the main reason to modify the function to return
> the number of statements that it reset. Without having any output from
> the function, there is no way that how many statements that the above
> function reset. Earlier it used to reset every statement, so I feel there is
> no need of any output, but I feel giving the number of statements with
> this approach is good.
>

Sure, but what are we going to achieve with that number?  What
information user is going to get by that?  If it can help us to ensure
that it has reset the expected number of statements, then I can see
the clear usage, but without that, the return value doesn't seem to
have any clear purpose.  So, I don't see much value in breaking
compatibility.

Does anyone else have an opinion on this matter?

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: New vacuum option to do only freezing
Next
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL Limits and lack of documentation about them.