Re: Introduce a new view for checkpointer related stats

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "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-11-23 06:09:43
Message-ID: CALj2ACVzcqBRHc7K706z2RAWKKiFcvgBSFi=u9mFkM1d-WHO=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 23, 2022 at 2:23 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2022-11-22 18:08:28 +0530, Bharath Rupireddy wrote:
> >
> > CREATE VIEW pg_stat_bgwriter AS
> > SELECT
> > - pg_stat_get_bgwriter_timed_checkpoints() AS checkpoints_timed,
> > - pg_stat_get_bgwriter_requested_checkpoints() AS checkpoints_req,
> > - pg_stat_get_checkpoint_write_time() AS checkpoint_write_time,
> > - pg_stat_get_checkpoint_sync_time() AS checkpoint_sync_time,
> > - pg_stat_get_bgwriter_buf_written_checkpoints() AS buffers_checkpoint,
> > pg_stat_get_bgwriter_buf_written_clean() AS buffers_clean,
> > pg_stat_get_bgwriter_maxwritten_clean() AS maxwritten_clean,
> > - pg_stat_get_buf_written_backend() AS buffers_backend,
> > - pg_stat_get_buf_fsync_backend() AS buffers_backend_fsync,
> > pg_stat_get_buf_alloc() AS buffers_alloc,
> > pg_stat_get_bgwriter_stat_reset_time() AS stats_reset;
>
>
> I think we should consider deprecating the pg_stat_bgwriter columns but
> leaving them in place for a few years. New stuff should only be added to
> pg_stat_checkpointer, but we don't need to break old monitoring queries.

May I know what it means to deprecate pg_stat_bgwriter columns? Are
you suggesting to add deprecation warnings to corresponding functions
pg_stat_get_bgwriter_buf_written_clean(),
pg_stat_get_bgwriter_maxwritten_clean(), pg_stat_get_buf_alloc() and
pg_stat_get_bgwriter_stat_reset_time() and in the docs? And eventually
do away with the bgwriter stats and the file pgstat_bgwriter.c? Aren't
the bgwriter stats buf_written_clean, maxwritten_clean and buf_alloc
useful?

I think we need to discuss the pg_stat_bgwriter deprecation separately
independent of the patch here, no?

PS: I noticed some discussion here
https://www.postgresql.org/message-id/20221121003815.qnwlnz2lhkow2e5w%40awork3.anarazel.de,
I haven't spent enough time on it.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-11-23 06:12:41 Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"
Previous Message Michael Paquier 2022-11-23 06:05:18 Re: Allow file inclusion in pg_hba and pg_ident files