Re: Introduce a new view for checkpointer related stats

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: sirisha chamarthi <sirichamarthi22(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Introduce a new view for checkpointer related stats
Date: 2022-12-02 07:30:25
Message-ID: CALj2ACV7hGqu95A7smwEM3SnY1OsyzGm+BicqrUH4VeWxyuLiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 2, 2022 at 12:54 PM sirisha chamarthi
<sirichamarthi22(at)gmail(dot)com> wrote:
>
> On Thu, Dec 1, 2022 at 9:50 PM Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>>
>> On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy
>> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>> >
>> > I don't have a strong opinion about changing column names. However, if
>> > we were to change it, I prefer to use names that
>> > PgStat_CheckpointerStats has. BTW, that's what
>> > PgStat_BgWriterStats/pg_stat_bgwriter and
>> > PgStat_ArchiverStats/pg_stat_archiver uses.
>>
>> After thinking about this a while, I convinced myself to change the
>> column names to be a bit more meaningful. I still think having
>> checkpoints in the column names is needed because it also has other
>> backend related columns. I'm attaching the v4 patch for further
>> review.
>> CREATE VIEW pg_stat_checkpointer AS
>> SELECT
>> pg_stat_get_timed_checkpoints() AS timed_checkpoints,
>> pg_stat_get_requested_checkpoints() AS requested_checkpoints,
>> pg_stat_get_checkpoint_write_time() AS checkpoint_write_time,
>> pg_stat_get_checkpoint_sync_time() AS checkpoint_sync_time,
>> pg_stat_get_buf_written_checkpoints() AS buffers_written_checkpoints,
>> pg_stat_get_buf_written_backend() AS buffers_written_backend,
>> pg_stat_get_buf_fsync_backend() AS buffers_fsync_backend,
>> pg_stat_get_checkpointer_stat_reset_time() AS stats_reset;
>
>
> IMO, “buffers_written_checkpoints” is confusing. What do you think?

Thanks. We can be "more and more" meaningful by naming
buffers_written_by_checkpoints, buffers_written_by_backend,
buffers_fsync_by_backend. However, I don't think that's a good idea
here as names get too long.

Having said that, I'll leave it to the committer's discretion.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-12-02 07:30:55 refactor ExecGrant_*() functions
Previous Message Richard Guo 2022-12-02 07:29:28 Re: Missing MaterialPath support in reparameterize_path_by_child