Re: pg_stat_reset_single_*_counters vs pg_stat_database.stats_reset

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Tomas Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: pg_stat_reset_single_*_counters vs pg_stat_database.stats_reset
Date: 2022-03-30 00:06:24
Message-ID: CAKFQuwYyJMhCpt-Ok+hhhrv3xym2rUynK-py+iqH=nJNVo4dDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 29, 2022 at 4:43 PM Andres Freund <andres(at)anarazel(dot)de> wrote:

> But more importantly, a
> per-relation/function reset field wouldn't address Tomas's concern: He
> wants a
> single thing to check to see if any stats have been reset - and that's imo
> a
> quite reasonable desire.
>

Per the original email:

"Starting with the below commit, pg_stat_reset_single_function_counters,
pg_stat_reset_single_table_counters don't just reset the stats for the
individual function, but also set pg_stat_database.stats_reset."

Thus we already have the desired behavior, it is just poorly documented.

Now, maybe other functions aren't doing this? If so, given these functions
do, we probably should just change any outliers to match.

I'm reading Tomas's comments as basically a defense of the status quo, at
least so far as the field goes. He didn't comment on the idea of "drop the
reset_[relation|function]_counters(...)" functions. Combined, I take that
as supporting the entire status quo: leaving the function and fields
as-is. I'm inclined to do the same. I don't see any real benefit to
change here as there is no user demand for it and the field change proposal
is to change only one of the at least three locations that should be
changed if we want to have a consistent design. And we aren't getting user
reports saying the presence of the functions is a problem (confusion or
otherwise) either, so unless there is a technical reason writing these
functions in the new system is undesirable we have no justification that I
can see for removing the long-standing feature.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2022-03-30 00:20:21 Re: [PATCH] Full support for index LP_DEAD hint bits on standby
Previous Message Andres Freund 2022-03-29 23:53:32 Re: [PATCH] Expose port->authn_id to extensions and triggers