Re: Introduce a new view for checkpointer related stats

2023-10-30 Thread Michael Paquier
On Mon, Oct 30, 2023 at 11:59:10AM +0530, Bharath Rupireddy wrote: > Oh, thanks for taking care of this. While at it, I noticed that > there's no coverage for pg_stat_reset_shared('recovery_prefetch') and > XLogPrefetchResetStats() >

Re: Introduce a new view for checkpointer related stats

2023-10-30 Thread Bharath Rupireddy
On Mon, Oct 30, 2023 at 6:19 AM Michael Paquier wrote: > > On Fri, Oct 27, 2023 at 10:23:34AM +0530, Bharath Rupireddy wrote: > > +1. Changed in the attached v10-001. FWIW, having a test case in > > stats.sql emitting this error message and hint would have helped here. > > If okay, I can add one.

Re: Introduce a new view for checkpointer related stats

2023-10-29 Thread Michael Paquier
On Fri, Oct 27, 2023 at 10:23:34AM +0530, Bharath Rupireddy wrote: > +1. Changed in the attached v10-001. FWIW, having a test case in > stats.sql emitting this error message and hint would have helped here. > If okay, I can add one. That may be something to do. At least it was missed on this

Re: Introduce a new view for checkpointer related stats

2023-10-26 Thread Bharath Rupireddy
On Fri, Oct 27, 2023 at 10:32 AM Michael Paquier wrote: > > On Fri, Oct 27, 2023 at 10:23:34AM +0530, Bharath Rupireddy wrote: > > A possible way is to move existing pgstat_count_slru_flush in > > SimpleLruWriteAll closer to pg_fsync and WAIT_EVENT_SLRU_SYNC in > > SlruPhysicalWritePage, remove

Re: Introduce a new view for checkpointer related stats

2023-10-26 Thread Michael Paquier
On Fri, Oct 27, 2023 at 10:23:34AM +0530, Bharath Rupireddy wrote: > A possible way is to move existing pgstat_count_slru_flush in > SimpleLruWriteAll closer to pg_fsync and WAIT_EVENT_SLRU_SYNC in > SlruPhysicalWritePage, remove WAIT_EVENT_SLRU_FLUSH_SYNC completely, > use WAIT_EVENT_SLRU_SYNC in

Re: Introduce a new view for checkpointer related stats

2023-10-26 Thread Bharath Rupireddy
On Fri, Oct 27, 2023 at 8:03 AM Michael Paquier wrote: > > Hmm. As per the existing call of pgstat_count_slru_flush() in > SimpleLruWriteAll(), routine called SimpleLruFlush() until ~13 and > dee663f78439, an incrementation of 1 for slru_stats_idx refers to all > the flushes for all the dirty

Re: Introduce a new view for checkpointer related stats

2023-10-26 Thread Michael Paquier
On Thu, Oct 26, 2023 at 10:55:00PM +0530, Bharath Rupireddy wrote: > On Thu, Oct 26, 2023 at 7:30 AM Michael Paquier wrote: >> Why is that in 0002? Isn't that something we should treat as a bug >> fix of its own, even backpatching it to make sure that the flush >> requests for individual

Re: Introduce a new view for checkpointer related stats

2023-10-26 Thread Bharath Rupireddy
On Thu, Oct 26, 2023 at 7:30 AM Michael Paquier wrote: > > I was looking at this patch, and got a few comments. Thanks. > The view for the bgwriter does not do that. I'd suggest to use > functions that are named as pg_stat_get_checkpoint_$att with shorter > $atts. It is true that "timed" is a

Re: Introduce a new view for checkpointer related stats

2023-10-25 Thread Michael Paquier
On Mon, Feb 13, 2023 at 11:31:03AM +0530, Bharath Rupireddy wrote: > Needed a rebase. Please review the attached v8 patch set. I was looking at this patch, and got a few comments. FWIW, I kind of agree with the feeling of Bertrand upthread that using "checkpoint_" in the attribute names for the

Re: Introduce a new view for checkpointer related stats

2023-02-12 Thread Bharath Rupireddy
On Fri, Feb 10, 2023 at 10:00 PM Bharath Rupireddy wrote: > > Thanks. FWIW, I've attached the patch introducing pg_stat_checkpointer > as 0003 here. > > Please review the attached v7 patch set. Needed a rebase. Please review the attached v8 patch set. -- Bharath Rupireddy PostgreSQL

Re: Introduce a new view for checkpointer related stats

2023-02-10 Thread Bharath Rupireddy
On Fri, Feb 10, 2023 at 6:16 AM Andres Freund wrote: > > That's true for buffers_fsync_backend, but not true for > buffers_backend/buffers_written_backend. > > That isn't tied to checkpointer. > > I think if we end up breaking compat, we should just drop that column. The > pg_stat_io patch from

Re: Introduce a new view for checkpointer related stats

2023-02-09 Thread Michael Paquier
On Thu, Feb 09, 2023 at 04:46:04PM -0800, Andres Freund wrote: > I think if we end up breaking compat, we should just drop that > column. Indeed. > Yep, and I think you are all wrong, and that this is just going to cause > unnecessary pain :). I'm not going to try to prevent the patch from going

Re: Introduce a new view for checkpointer related stats

2023-02-09 Thread Andres Freund
Hi, On 2023-02-09 19:00:00 +0530, Bharath Rupireddy wrote: > On Thu, Feb 9, 2023 at 12:33 PM Andres Freund wrote: > > On 2023-02-09 12:21:51 +0530, Bharath Rupireddy wrote: > > > @@ -1105,18 +1105,22 @@ CREATE VIEW pg_stat_archiver AS > > > > > > CREATE VIEW pg_stat_bgwriter AS > > >

Re: Introduce a new view for checkpointer related stats

2023-02-09 Thread Bharath Rupireddy
On Thu, Feb 9, 2023 at 12:33 PM Andres Freund wrote: > > Hi, Thanks for looking at this. > On 2023-02-09 12:21:51 +0530, Bharath Rupireddy wrote: > > @@ -1105,18 +1105,22 @@ CREATE VIEW pg_stat_archiver AS > > > > CREATE VIEW pg_stat_bgwriter AS > > SELECT > > -

Re: Introduce a new view for checkpointer related stats

2023-02-08 Thread Andres Freund
Hi, On 2023-02-09 12:21:51 +0530, Bharath Rupireddy wrote: > @@ -1105,18 +1105,22 @@ CREATE VIEW pg_stat_archiver AS > > CREATE VIEW pg_stat_bgwriter AS > SELECT > -pg_stat_get_bgwriter_timed_checkpoints() AS checkpoints_timed, > -

Re: Introduce a new view for checkpointer related stats

2023-02-08 Thread Bharath Rupireddy
On Sat, Jan 21, 2023 at 5:56 AM Bharath Rupireddy wrote: > > On Fri, Dec 2, 2022 at 1:07 PM Drouvot, Bertrand > wrote: > > > > Patch LGTM, marking it as Ready for Committer. > > Had to rebase, attached v5 patch for further consideration. One more rebase due to 28e626bd (pgstat: Infrastructure

Re: Introduce a new view for checkpointer related stats

2023-01-20 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 1:07 PM Drouvot, Bertrand wrote: > > Patch LGTM, marking it as Ready for Committer. Had to rebase, attached v5 patch for further consideration. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com From

Re: Introduce a new view for checkpointer related stats

2023-01-20 Thread Nathan Bossart
On Fri, Dec 02, 2022 at 08:36:38AM +0100, Drouvot, Bertrand wrote: > Patch LGTM, marking it as Ready for Committer. Unfortunately, this patch no longer applies. Bharath, would you mind posting a rebased version? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Introduce a new view for checkpointer related stats

2022-12-13 Thread Nitin Jadhav
The patch looks good to me. Thanks & Regards, Nitin Jadhav On Fri, Dec 2, 2022 at 11:20 AM Bharath Rupireddy wrote: > > On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy > wrote: > > > > I don't have a strong opinion about changing column names. However, if > > we were to change it, I prefer

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Drouvot, Bertrand
Hi, On 12/2/22 6:50 AM, Bharath Rupireddy wrote: On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy 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

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 12:54 PM sirisha chamarthi wrote: > > On Thu, Dec 1, 2022 at 9:50 PM Bharath Rupireddy > wrote: >> >> On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy >> wrote: >> > >> > I don't have a strong opinion about changing column names. However, if >> > we were to change it, I

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread sirisha chamarthi
On Thu, Dec 1, 2022 at 9:50 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy > 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 > >

Re: Introduce a new view for checkpointer related stats

2022-12-01 Thread Bharath Rupireddy
On Wed, Nov 30, 2022 at 5:15 PM Bharath Rupireddy 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 >

Re: Introduce a new view for checkpointer related stats

2022-11-30 Thread Bharath Rupireddy
On Wed, Nov 30, 2022 at 12:44 PM Drouvot, Bertrand wrote: > > +CREATE VIEW pg_stat_checkpointer AS > +SELECT > +pg_stat_get_timed_checkpoints() AS checkpoints_timed, > +pg_stat_get_requested_checkpoints() AS checkpoints_req, > +pg_stat_get_checkpoint_write_time() AS

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Drouvot, Bertrand
Hi, On 11/30/22 7:34 AM, Bharath Rupireddy wrote: On Wed, Nov 30, 2022 at 6:01 AM Andres Freund wrote: Hi, On 2022-11-28 12:58:48 -0500, Robert Haas wrote: On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: I think we should consider deprecating the pg_stat_bgwriter columns but leaving

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Bharath Rupireddy
On Wed, Nov 30, 2022 at 6:01 AM Andres Freund wrote: > > Hi, > > On 2022-11-28 12:58:48 -0500, Robert Haas wrote: > > On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > > > I think we should consider deprecating the pg_stat_bgwriter columns but > > > leaving them in place for a few years.

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Andres Freund
Hi, On 2022-11-28 12:58:48 -0500, Robert Haas wrote: > On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > > 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

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Greg Stark
On Mon, 28 Nov 2022 at 13:00, Robert Haas wrote: > > On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > I vote to just remove them. I think that most people won't update > their queries until they are forced to do so. I don't think it > matters very much when we force them to do that. I

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Drouvot, Bertrand
Hi, On 11/28/22 6:58 PM, Robert Haas wrote: On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: 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

Re: Introduce a new view for checkpointer related stats

2022-11-29 Thread Amit Kapila
On Mon, Nov 28, 2022 at 11:29 PM Robert Haas wrote: > > On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > > 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

Re: Introduce a new view for checkpointer related stats

2022-11-28 Thread Bharath Rupireddy
On Mon, Nov 28, 2022 at 11:29 PM Robert Haas wrote: > > On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > > 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

Re: Introduce a new view for checkpointer related stats

2022-11-28 Thread Robert Haas
On Tue, Nov 22, 2022 at 3:53 PM Andres Freund wrote: > 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. I vote to just

Re: Introduce a new view for checkpointer related stats

2022-11-28 Thread Bharath Rupireddy
On Sat, Nov 26, 2022 at 4:32 AM Andres Freund wrote: > Thanks Andres for reviewing. > > May I know what it means to deprecate pg_stat_bgwriter columns? > > Add a note to the docs saying that the columns will be removed. Done. > > Are > > you suggesting to add deprecation warnings to

Re: Introduce a new view for checkpointer related stats

2022-11-25 Thread Andres Freund
Hi, On 2022-11-23 11:39:43 +0530, Bharath Rupireddy wrote: > On Wed, Nov 23, 2022 at 2:23 AM Andres Freund 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()

Re: Introduce a new view for checkpointer related stats

2022-11-22 Thread Bharath Rupireddy
On Wed, Nov 23, 2022 at 2:23 AM Andres Freund 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, > > -

Re: Introduce a new view for checkpointer related stats

2022-11-22 Thread Andres Freund
Hi, On 2022-11-22 18:08:28 +0530, Bharath Rupireddy wrote: > diff --git a/src/backend/catalog/system_views.sql > b/src/backend/catalog/system_views.sql > index 2d8104b090..131d949dfb 100644 > --- a/src/backend/catalog/system_views.sql > +++ b/src/backend/catalog/system_views.sql > @@ -1105,18

Re: Introduce a new view for checkpointer related stats

2022-11-22 Thread Bharath Rupireddy
On Tue, Nov 22, 2022 at 1:26 PM Drouvot, Bertrand wrote: > > Hi, > > On 11/17/22 1:51 PM, Bharath Rupireddy wrote: > > Hi, > > > > pg_stat_bgwriter view currently reports checkpointer stats as well. It > > is that way because historically checkpointer was part of bgwriter > > until the commits

Re: Introduce a new view for checkpointer related stats

2022-11-21 Thread Drouvot, Bertrand
Hi, On 11/17/22 1:51 PM, Bharath Rupireddy wrote: Hi, pg_stat_bgwriter view currently reports checkpointer stats as well. It is that way because historically checkpointer was part of bgwriter until the commits 806a2ae and bf405ba, that went into PG 9.2, separated them out. I think it is time