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
0001. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com From d64200c575bf8c9f54bdefad95f84dff5a8381eb Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Fri, 27 Oct 2023 04:42:55 + Subject: [PATCH v10] Introduce a ne

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
_backend() AS buffers_backend_fsync, pg_stat_get_buf_alloc() AS buffers_alloc, pg_stat_get_bgwriter_stat_reset_time() AS stats_reset; pg_stat_database| SELECT oid AS datid, -- 2.34.1 From 5b349d6b3a3b8db1498e038aed81909fd1f15fe4 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy D

Re: Introduce a new view for checkpointer related stats

2023-02-10 Thread Bharath Rupireddy
AS buffers_alloc, pg_stat_get_bgwriter_stat_reset_time() AS stats_reset; pg_stat_database| SELECT oid AS datid, -- 2.34.1 From c7dd583d288add34a7fdb412675d2b6258480f1e Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Fri, 10 Feb 2023 16:04:27 + Subject: [PATCH v7] Introduce a new v

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
, 9 Feb 2023 06:25:35 + Subject: [PATCH v6] Introduce a new view for checkpointer related stats 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

Re: Introduce a new view for checkpointer related stats

2023-01-20 Thread Bharath Rupireddy
m From e705916c40649d13a66299159cc992d0572960f5 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Fri, 20 Jan 2023 14:20:03 + Subject: [PATCH v5] Introduce a new view for checkpointer related stats pg_stat_bgwriter view currently reports checkpointer stats as well. It is that way b

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
e() AS stats_reset; -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com From 8280223b2b8fde888dd8540328336421bbf6138c Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Fri, 2 Dec 2022 04:58:46 + Subject: [PATCH v4] In

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
s.amazon.com From ec09bfcde836cb23f090fd6088b89f0fb9a68000 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Mon, 28 Nov 2022 10:07:55 + Subject: [PATCH v3] Introduce a new view for checkpointer related stats pg_stat_bgwriter view currently reports checkpointer stats as well. It is that way beca

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
nges are less i.e. replace pg_stat_bgwriter with the new view. I'm attaching the v2 patch for further review. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com From 724d9bee5bc3bc124dd37909878a6450c4fe1019 Mon Sep 17 00:00:00

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

Introduce a new view for checkpointer related stats

2022-11-17 Thread Bharath Rupireddy
Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com From 707b3f0e0e7cf55b48a09709b070341d23ad03b8 Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Thu, 17 Nov 2022 12:20:13 + Subject: [PATCH v1] Introduce a new view for checkpointer